コード例 #1
0
 @Override
 public void deactivate() {
   if (isActive()) {
     doDeActivate();
     ActionsInput input = getWidgetModel().getActionsInput();
     for (AbstractWidgetAction a : input.getActionsList()) {
       a.dispose();
     }
     super.deactivate();
     // remove listener from all properties.
     for (String id : getWidgetModel().getAllPropertyIDs()) {
       getWidgetModel()
           .getProperty(id)
           .removeAllPropertyChangeListeners(); // removePropertyChangeListener(propertyListenerMap.get(id));
     }
     if (executionMode == ExecutionMode.RUN_MODE) {
       // remove script listeners before stopping PV.
       for (ScriptData scriptData : scriptDataList) {
         ScriptService.getInstance().unRegisterScript(scriptData);
       }
       if (hasStartedPVs) {
         // this is just a guard statement
         // if the widget was deactivated before it became fully active (and connected its pv),
         // we should not attempt to stop those pvs; this can happen with linking container
         for (Object pv : pvMap.values().toArray()) {
           ((IPV) pv).stop();
         }
       }
     }
     propertyListenerMap.clear();
     // propertyListenerMap = null;
     SingleSourceHelper.rapDeactivateBaseEditPart(this);
   }
 }
コード例 #2
0
 @Override
 protected void doDeActivate() {
   if (isActive()) {
     delegate.doDeActivate();
     super.doDeActivate();
   }
 }