Blog do projektu Open Source JavaHotel

sobota, 29 października 2011

DB2 script launcher, Eclipse plugin (continue)

I added two small enhancements to DB2 script launcher.
Enhancement 1
Launch configuration dialog automatically for the first time when user right-clicked "Run as script launcher" and any configuration has been created so far (source).
Code snippet:
// Open launch configuration dialog for enter first configuration
  String name = manager.generateLaunchConfigurationName(NEW_CONFIGURATION);
  ILaunchConfigurationWorkingCopy wc = type.newInstance(null,name);
  configuration = wc.doSave();
  LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
                                
  ILaunchGroup group = lcm.getLaunchGroup(type, ILaunchManager.RUN_MODE);
  DebugUITools.openLaunchConfigurationPropertiesDialog(getShell(), configuration, group.getIdentifier());

Enhancement 2
The second is related to the problem of invalidating launch configuration when user is changing something. It was achieved be means of updateLaunchConfigurationDialog() method. Code snippet (source):
ModifyListener listener = new ModifyListener() {

  @Override
  public void modifyText(ModifyEvent arg0) {
     updateLaunchConfigurationDialog();
  }
};
............
  db2Alias.addModifyListener(listener);

Brak komentarzy:

Prześlij komentarz