コード例 #1
0
 @Override
 public boolean close() {
   if (mSection != null) {
     INIFile iniFile = (INIFile) mSection.getParent();
     if (iniFile != null) {
       iniFile.setValidateFixMode(mOldValidateFixMode);
     }
   }
   if (mCurrentWidget != null) {
     mCurrentWidget.removeModelCommandListener(InstallOptionsWidgetEditorDialog.this);
     mCurrentWidget.removePropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
     if (mCurrentWidget.getParent() != null) {
       mCurrentWidget
           .getParent()
           .removePropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
     }
   }
   return super.close();
 }
コード例 #2
0
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getPropertyName().equals(InstallOptionsModel.PROPERTY_INDEX)) {
     mDialog.moveChild(mCurrentWidget, ((Integer) evt.getNewValue()).intValue());
   } else if (evt.getPropertyName().equals(InstallOptionsModel.PROPERTY_CHILDREN)) {
     if (Common.objectsAreEqual(mCurrentWidget, evt.getOldValue())
         && evt.getNewValue() instanceof InstallOptionsWidget) {
       InstallOptionsWidget widget = (InstallOptionsWidget) evt.getNewValue();
       mCurrentWidget.removeModelCommandListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget.removePropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget = widget;
       mSection = mCurrentWidget.getSection();
       mCurrentWidget.addModelCommandListener(InstallOptionsWidgetEditorDialog.this);
       mCurrentWidget.addPropertyChangeListener(InstallOptionsWidgetEditorDialog.this);
       Display.getDefault()
           .asyncExec(
               new Runnable() {
                 public void run() {
                   mPage.selectionChanged(null, new StructuredSelection(mCurrentWidget));
                 }
               });
     }
   }
 }