OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 /** | 50 /** |
51 * A minimal "About Dart" dialog shell. | 51 * A minimal "About Dart" dialog shell. |
52 */ | 52 */ |
53 public class AboutDartDialog extends Shell implements DetailsProvider { | 53 public class AboutDartDialog extends Shell implements DetailsProvider { |
54 | 54 |
55 private static final ImageDescriptor ABOUT_IMG_DESC = ImageDescriptor.createFr omURL(Platform.getBundle( | 55 private static final ImageDescriptor ABOUT_IMG_DESC = ImageDescriptor.createFr omURL(Platform.getBundle( |
56 DartUI.ID_PLUGIN).getEntry(DialogsMessages.AboutDartDialog_about_image)); | 56 DartUI.ID_PLUGIN).getEntry(DialogsMessages.AboutDartDialog_about_image)); |
57 | 57 |
58 private static final String NEW_LINE = System.getProperty("line.separator"); | 58 private static final String NEW_LINE = System.getProperty("line.separator"); |
59 | 59 |
60 private static String getChannelLabel() { | |
61 //TODO (pquitslund): move to UpdateUtils | |
62 String updateUrl = UpdateCore.getUpdateUrl(); | |
danrubel
2013/11/07 23:20:20
Can getUpdateUrl() ever return null?
| |
63 if (updateUrl.contains("/channels/be/")) { | |
64 return " (BLEEDING EDGE) "; | |
65 } | |
66 if (updateUrl.contains("/channels/dev/")) { | |
67 return " (DEV) "; | |
68 } | |
69 if (updateUrl.contains("/channels/stable/")) { | |
70 return " (STABLE) "; | |
71 } | |
72 //Fall through | |
73 return ""; | |
74 } | |
75 | |
60 private final UpdateListener updateListener = new UpdateAdapter() { | 76 private final UpdateListener updateListener = new UpdateAdapter() { |
61 @Override | 77 @Override |
62 public void installing() { | 78 public void installing() { |
63 AboutDartDialog.this.close(); | 79 AboutDartDialog.this.close(); |
64 } | 80 } |
65 }; | 81 }; |
66 | 82 |
67 public AboutDartDialog(Shell shell) { | 83 public AboutDartDialog(Shell shell) { |
68 super(shell, SWT.CLOSE | SWT.TITLE); | 84 super(shell, SWT.CLOSE | SWT.TITLE); |
69 | 85 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
229 | 245 |
230 private void addCopyDetailsPopup(Control control) { | 246 private void addCopyDetailsPopup(Control control) { |
231 CopyDetailsToClipboardAction.addCopyDetailsPopup(control, this); | 247 CopyDetailsToClipboardAction.addCopyDetailsPopup(control, this); |
232 } | 248 } |
233 | 249 |
234 private void center(Control control) { | 250 private void center(Control control) { |
235 GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(control ); | 251 GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(control ); |
236 } | 252 } |
237 | 253 |
238 private String getVersion() { | 254 private String getVersion() { |
239 return DartToolsPlugin.getVersionString(); | 255 return DartToolsPlugin.getVersionString() + getChannelLabel(); |
240 } | 256 } |
241 | 257 |
242 private Label newLabel(int style) { | 258 private Label newLabel(int style) { |
243 Label label = new Label(this, style); | 259 Label label = new Label(this, style); |
244 label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); | 260 label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); |
245 return label; | 261 return label; |
246 } | 262 } |
247 | 263 |
248 } | 264 } |
OLD | NEW |