コード例 #1
0
 /**
  * Constructs an action that opens the launch configuration dialog in the context of the specified
  * launch group.
  *
  * @param identifier unique identifier of a launch group extension
  */
 public OpenLaunchDialogAction(String identifier) {
   fIdentifier = identifier;
   ILaunchGroup group =
       DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier);
   if (group != null) {
     String lbl = group.getLabel();
     String actionLabel =
         MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl});
     setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel));
   }
   PlatformUI.getWorkbench()
       .getHelpSystem()
       .setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION);
 }
コード例 #2
0
 public Object[] getElements(Object inputElement) {
   ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
   List possibleGroups = new ArrayList();
   ILaunchConfiguration configuration = (ILaunchConfiguration) inputElement;
   for (int i = 0; i < groups.length; i++) {
     ILaunchGroup extension = groups[i];
     LaunchHistory history =
         getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
     if (history != null && history.accepts(configuration)) {
       possibleGroups.add(extension);
     }
   }
   return possibleGroups.toArray();
 }