| 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(); |
| 63 if (updateUrl != null) { |
| 64 if (updateUrl.contains("/channels/be/")) { |
| 65 return " (BLEEDING EDGE)"; |
| 66 } |
| 67 if (updateUrl.contains("/channels/dev/")) { |
| 68 return " (DEV)"; |
| 69 } |
| 70 if (updateUrl.contains("/channels/stable/")) { |
| 71 return " (STABLE)"; |
| 72 } |
| 73 } |
| 74 //Fall through |
| 75 return ""; |
| 76 } |
| 77 |
| 60 private final UpdateListener updateListener = new UpdateAdapter() { | 78 private final UpdateListener updateListener = new UpdateAdapter() { |
| 61 @Override | 79 @Override |
| 62 public void installing() { | 80 public void installing() { |
| 63 AboutDartDialog.this.close(); | 81 AboutDartDialog.this.close(); |
| 64 } | 82 } |
| 65 }; | 83 }; |
| 66 | 84 |
| 67 public AboutDartDialog(Shell shell) { | 85 public AboutDartDialog(Shell shell) { |
| 68 super(shell, SWT.CLOSE | SWT.TITLE); | 86 super(shell, SWT.CLOSE | SWT.TITLE); |
| 69 | 87 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 247 |
| 230 private void addCopyDetailsPopup(Control control) { | 248 private void addCopyDetailsPopup(Control control) { |
| 231 CopyDetailsToClipboardAction.addCopyDetailsPopup(control, this); | 249 CopyDetailsToClipboardAction.addCopyDetailsPopup(control, this); |
| 232 } | 250 } |
| 233 | 251 |
| 234 private void center(Control control) { | 252 private void center(Control control) { |
| 235 GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(control
); | 253 GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(control
); |
| 236 } | 254 } |
| 237 | 255 |
| 238 private String getVersion() { | 256 private String getVersion() { |
| 239 return DartToolsPlugin.getVersionString(); | 257 return DartToolsPlugin.getVersionString() + getChannelLabel(); |
| 240 } | 258 } |
| 241 | 259 |
| 242 private Label newLabel(int style) { | 260 private Label newLabel(int style) { |
| 243 Label label = new Label(this, style); | 261 Label label = new Label(this, style); |
| 244 label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); | 262 label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); |
| 245 return label; | 263 return label; |
| 246 } | 264 } |
| 247 | 265 |
| 248 } | 266 } |
| OLD | NEW |