Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 262924
Collapse All | Expand All

(-)src/org/eclipse/pde/api/tools/ui/internal/preferences/ApiErrorsWarningsConfigurationBlock.java (-15 / +43 lines)
Lines 15-20 Link Here
15
import java.util.Iterator;
15
import java.util.Iterator;
16
import java.util.List;
16
import java.util.List;
17
17
18
import org.eclipse.core.commands.Command;
19
import org.eclipse.core.commands.ExecutionException;
20
import org.eclipse.core.commands.NotEnabledException;
21
import org.eclipse.core.commands.NotHandledException;
22
import org.eclipse.core.commands.common.NotDefinedException;
18
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IProject;
19
import org.eclipse.core.resources.ProjectScope;
24
import org.eclipse.core.resources.ProjectScope;
20
import org.eclipse.core.runtime.preferences.DefaultScope;
25
import org.eclipse.core.runtime.preferences.DefaultScope;
Lines 58-63 Link Here
58
import org.eclipse.swt.widgets.TabItem;
63
import org.eclipse.swt.widgets.TabItem;
59
import org.eclipse.swt.widgets.Widget;
64
import org.eclipse.swt.widgets.Widget;
60
import org.eclipse.ui.PlatformUI;
65
import org.eclipse.ui.PlatformUI;
66
import org.eclipse.ui.commands.ICommandService;
61
import org.eclipse.ui.forms.events.ExpansionAdapter;
67
import org.eclipse.ui.forms.events.ExpansionAdapter;
62
import org.eclipse.ui.forms.events.ExpansionEvent;
68
import org.eclipse.ui.forms.events.ExpansionEvent;
63
import org.eclipse.ui.forms.widgets.ExpandableComposite;
69
import org.eclipse.ui.forms.widgets.ExpandableComposite;
Lines 1278-1300 Link Here
1278
			}
1284
			}
1279
		}
1285
		}
1280
		if (installMore) {
1286
		if (installMore) {
1281
			String linkedName = PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label;
1287
			ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
1282
			SWTFactory.createVerticalSpacer(group, 1);
1288
			final Command command = commandService.getCommand(P2_INSTALL_COMMAND_HANDLER);
1283
			Link link = SWTFactory.createLink(group, linkedName, JFaceResources.getDialogFont(), 3);
1289
			if (command.isHandled()) {
1284
			link.setToolTipText(PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip);
1290
				String linkedName = PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label;
1285
			link.addMouseListener(new MouseAdapter() {
1291
				SWTFactory.createVerticalSpacer(group, 1);
1286
				public void mouseDown(MouseEvent e) {
1292
				Link link = SWTFactory.createLink(group, linkedName, JFaceResources.getDialogFont(), 3);
1287
					IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
1293
				link.setToolTipText(PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip);
1288
					if(handlerService != null) {
1294
				link.addMouseListener(new MouseAdapter() {
1289
						try {
1295
					public void mouseDown(MouseEvent e) {
1290
							handlerService.executeCommand(P2_INSTALL_COMMAND_HANDLER, null);
1296
						IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
1291
						} catch (Exception ex) {
1297
						if(handlerService != null) {
1292
							ex.printStackTrace();
1298
							try {
1299
								command.executeWithChecks(handlerService.createExecutionEvent(command, null));
1300
							} catch (ExecutionException ex) {
1301
								MessageDialog.openError(
1302
										ApiUIPlugin.getShell(),
1303
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title,
1304
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description);
1305
							} catch (NotDefinedException ex) {
1306
								MessageDialog.openError(
1307
										ApiUIPlugin.getShell(),
1308
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title,
1309
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description);
1310
							} catch (NotEnabledException ex) {
1311
								MessageDialog.openError(
1312
										ApiUIPlugin.getShell(),
1313
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title,
1314
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description);
1315
							} catch (NotHandledException ex) {
1316
								MessageDialog.openError(
1317
										ApiUIPlugin.getShell(),
1318
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title,
1319
										PreferenceMessages.ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description);
1320
							}
1293
						}
1321
						}
1294
					}
1322
					}
1295
				}
1323
				});
1296
			});
1324
				this.fSystemLibraryControls.add(link);
1297
			this.fSystemLibraryControls.add(link);
1325
			}
1298
		}
1326
		}
1299
	}
1327
	}
1300
1328
(-)src/org/eclipse/pde/api/tools/ui/internal/preferences/preferencemessages.properties (-1 / +3 lines)
Lines 160-163 Link Here
160
ApiProblemSeveritiesConfigurationBlock_checkable_ees=Supported Environments:
160
ApiProblemSeveritiesConfigurationBlock_checkable_ees=Supported Environments:
161
ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip=Click to install one or more environment descriptions
161
ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip=Click to install one or more environment descriptions
162
ApiErrorsWarningsConfigurationBlock_no_ees_installed=There are no execution descriptions installed.
162
ApiErrorsWarningsConfigurationBlock_no_ees_installed=There are no execution descriptions installed.
163
ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label=Additional environment descriptions are available: <a>install them now</a>
163
ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label=Additional environment descriptions are available: <a>install them now</a>
164
ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title=An error occurred
165
ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description=The "Install New Software..." wizard could not be opened.\nCheck the .log file.
(-)src/org/eclipse/pde/api/tools/ui/internal/preferences/PreferenceMessages.java (+2 lines)
Lines 168-173 Link Here
168
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees;
168
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees;
169
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip;
169
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_tooltip;
170
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label;
170
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_link_label;
171
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_title;
172
	public static String ApiProblemSeveritiesConfigurationBlock_checkable_ees_error_dialog_description;
171
173
172
	static {
174
	static {
173
		// initialize resource bundle
175
		// initialize resource bundle

Return to bug 262924