|
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 |
|