Пример #1
0
 @Override
 public void propertyChange(PropertyChangeEvent event) {
   if (event.getProperty().startsWith(IPreferenceConstants.DEFAULT_FILL_COLOR_PREFIX)
       || event
           .getProperty()
           .equals(
               IPreferenceConstants
                   .SAVE_USER_DEFAULT_COLOR)) { // This will affect the "Default" menu in
                                                // color chooser
     refreshControls();
   }
 }
 public void propertyChange(PropertyChangeEvent event) {
   if (activeEditor == null) {
     return;
   }
   if (event.getSource() == undoAction) {
     if (event.getProperty().equals("chosen")) {
       activeEditor.undo();
     }
   } else if (event.getSource() == redoAction) {
     if (event.getProperty().equals("chosen")) {
       activeEditor.redo();
     }
   }
 }
Пример #3
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
  */
 public void propertyChange(PropertyChangeEvent event) {
   count++;
   if (event.getProperty() == IEvaluationService.RESULT
       && event.getNewValue() instanceof Boolean) {
     currentValue = ((Boolean) event.getNewValue()).booleanValue();
   }
 }
Пример #4
0
 @Override
 public void propertyChange(final PropertyChangeEvent event) {
   if (event.getProperty().equals(IMPROVConstants.GV_SELECTION)) {
     final IDataSource ds = DataSourceManager.getInstance().getActiveDatasource();
     org.eclipse.swt.graphics.Rectangle bounds = mControl.getBounds();
     final int width = bounds.width;
     final int height = bounds.height;
     if (ds != null && ds instanceof TreeDBDataSource) {
       new UIJob("") {
         @Override
         public IStatus runInUIThread(IProgressMonitor monitor) {
           Object newValue = event.getNewValue();
           if (newValue != null) {
             StructuredSelection sSelection = (StructuredSelection) newValue;
             Iterator<?> iter = sSelection.iterator();
             int[] nodes = (int[]) iter.next();
             int[][] edges = (int[][]) iter.next();
             VisualItem item = (VisualItem) iter.next();
             int[] selection = new int[] {item.getInt("id")};
             mTreeView.clearView();
             mTreeView.setViewItems(nodes, edges, selection);
             mTreeView.setSize(width, height);
             mTreeView.repaint();
           }
           return Status.OK_STATUS;
         }
       }.schedule();
     }
   }
 }
Пример #5
0
 public void propertyChange(PropertyChangeEvent event) {
   if (event.getProperty().equals(TefkatPlugin.URIMAP_PREFERENCE)) {
     if (null != event.getOldValue()) {
       List list = TefkatPlugin.convertFromString((String) event.getOldValue());
       for (final Iterator itr = list.iterator(); itr.hasNext(); ) {
         URIMap map = (URIMap) itr.next();
         if (map.enabled) {
           URI uri = URI.createURI(map.source);
           URIConverter.URI_MAP.remove(uri);
         }
       }
     }
     if (null != event.getNewValue()) {
       List list = TefkatPlugin.convertFromString((String) event.getNewValue());
       for (final Iterator itr = list.iterator(); itr.hasNext(); ) {
         URIMap map = (URIMap) itr.next();
         if (map.enabled) {
           URI sourceUri = URI.createURI(map.source);
           URI targetUri = URI.createURI(map.target);
           URIConverter.URI_MAP.put(sourceUri, targetUri);
         }
       }
     }
   }
 }
  private void adaptToTextForegroundChange(Highlighting highlighting, PropertyChangeEvent event) {
    RGB rgb = null;

    Object value = event.getNewValue();
    if (value instanceof RGB) rgb = (RGB) value;
    else if (value instanceof String) rgb = StringConverter.asRGB((String) value);

    if (rgb != null) {

      String property = event.getProperty();
      Color color = fColorManager.getColor(property);

      if ((color == null || !rgb.equals(color.getRGB()))
          && fColorManager instanceof IColorManagerExtension) {
        IColorManagerExtension ext = (IColorManagerExtension) fColorManager;
        ext.unbindColor(property);
        ext.bindColor(property, rgb);
        color = fColorManager.getColor(property);
      }

      TextAttribute oldAttr = highlighting.getTextAttribute();
      highlighting.setTextAttribute(
          new TextAttribute(color, oldAttr.getBackground(), oldAttr.getStyle()));
    }
  }
Пример #7
0
  /**
   * Callback that is invoked when a property in the compare configuration ( {@link
   * #getCompareConfiguration()} changes.
   *
   * @param event the property change event
   * @since 3.3
   */
  protected void handlePropertyChangeEvent(PropertyChangeEvent event) {

    String key = event.getProperty();

    if (key.equals(ICompareUIConstants.PROP_ANCESTOR_VISIBLE)) {
      fAncestorVisible =
          Utilities.getBoolean(
              getCompareConfiguration(),
              ICompareUIConstants.PROP_ANCESTOR_VISIBLE,
              fAncestorVisible);
      fComposite.layout(true);

      updateCursor(fLeftLabel, VERTICAL);
      updateCursor(fDirectionLabel, HORIZONTAL | VERTICAL);
      updateCursor(fRightLabel, VERTICAL);

      return;
    }

    if (key.equals(ICompareUIConstants.PROP_IGNORE_ANCESTOR)) {
      setAncestorVisibility(
          false,
          !Utilities.getBoolean(
              getCompareConfiguration(), ICompareUIConstants.PROP_IGNORE_ANCESTOR, false));
      return;
    }
  }
Пример #8
0
  @Override
  protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
    ISourceViewer sourceViewer = getSourceViewer();
    if (sourceViewer == null) return;

    String property = event.getProperty();

    AutoconfCodeScanner scanner = (AutoconfCodeScanner) getAutoconfCodeScanner();
    if (scanner != null) {
      if (scanner.affectsBehavior(event)) {
        scanner.adaptToPreferenceChange(event);
        sourceViewer.invalidateTextPresentation();
      }
    }

    if (AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION.equals(property)
        || AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION.equals(property)) {
      handleVersionChange(sourceViewer);
    } else if (AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED.equals(property)) {
      if (sourceViewer instanceof ProjectionViewer) {
        ProjectionViewer projectionViewer = (ProjectionViewer) sourceViewer;
        if (fProjectionFileUpdater != null) fProjectionFileUpdater.uninstall();
        // either freshly enabled or provider changed
        fProjectionFileUpdater = new ProjectionFileUpdater();
        if (fProjectionFileUpdater != null) {
          fProjectionFileUpdater.install(this, projectionViewer);
        }
      }
      return;
    }

    super.handlePreferenceStoreChanged(event);
  }
 /**
  * Adapts the behavior of the contained components to the change encoded in the given event.
  *
  * <p>Clients are not allowed to call this method if the old setup with text tools is in use.
  *
  * @param event the event to which to adapt
  * @see DartSourceViewerConfiguration#JavaSourceViewerConfiguration(IColorManager,
  *     IPreferenceStore, ITextEditor, String)
  */
 public void handlePropertyChangeEvent(PropertyChangeEvent event) {
   Assert.isTrue(isNewSetup());
   if (fCodeScanner.affectsBehavior(event)) {
     fCodeScanner.adaptToPreferenceChange(event);
   }
   if (fMultilineCommentScanner.affectsBehavior(event)) {
     fMultilineCommentScanner.adaptToPreferenceChange(event);
   }
   if (fSinglelineCommentScanner.affectsBehavior(event)) {
     fSinglelineCommentScanner.adaptToPreferenceChange(event);
   }
   if (fStringScanner.affectsBehavior(event)) {
     fStringScanner.adaptToPreferenceChange(event);
   }
   if (fMultilineStringScanner.affectsBehavior(event)) {
     fMultilineStringScanner.adaptToPreferenceChange(event);
   }
   if (fJavaDocScanner.affectsBehavior(event)) {
     fJavaDocScanner.adaptToPreferenceChange(event);
   }
   if (fJavaDoubleClickSelector != null
       && JavaScriptCore.COMPILER_SOURCE.equals(event.getProperty())) {
     if (event.getNewValue() instanceof String) {
       fJavaDoubleClickSelector.setSourceVersion((String) event.getNewValue());
     }
   }
 }
 /** Reacts to any changes in the properties for the Mark Occurrences */
 public void propertyChange(PropertyChangeEvent event) {
   final String property = event.getProperty();
   boolean newBooleanValue = false;
   Object newValue = event.getNewValue();
   if (newValue != null) {
     newBooleanValue = Boolean.valueOf(newValue.toString()).booleanValue();
   }
   if (com.aptana.editor.common.preferences.IPreferenceConstants.EDITOR_MARK_OCCURRENCES.equals(
       property)) {
     if (newBooleanValue != fMarkOccurrenceAnnotations) {
       fMarkOccurrenceAnnotations = newBooleanValue;
       if (!fMarkOccurrenceAnnotations) {
         uninstallOccurrencesFinder();
       } else {
         installOccurrencesFinder(true);
       }
     }
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_TYPE_OCCURRENCES.equals(property)) {
     fMarkTypeOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_METHOD_OCCURRENCES.equals(property)) {
     fMarkMethodOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_FUNCTION_OCCURRENCES.equals(property)) {
     fMarkFunctionOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_CONSTANT_OCCURRENCES.equals(property)) {
     fMarkConstantOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_GLOBAL_VARIABLE_OCCURRENCES.equals(property)) {
     fMarkGlobalVariableOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_LOCAL_VARIABLE_OCCURRENCES.equals(property)) {
     fMarkLocalVariableOccurrences = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_METHOD_EXIT_POINTS.equals(property)) {
     fMarkMethodExitPoints = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_BREAK_CONTINUE_TARGETS.equals(property)) {
     fMarkBreakContinueTargets = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_MARK_IMPLEMENTORS.equals(property)) {
     fMarkImplementors = newBooleanValue;
     return;
   }
   if (PreferenceConstants.EDITOR_STICKY_OCCURRENCES.equals(property)) {
     fStickyOccurrenceAnnotations = newBooleanValue;
     return;
   }
 }
  private void adaptToStyleChange(PropertyChangeEvent event) {
    boolean bold = false;
    // bold properties need to be converted to colors for the map
    String colorPlusStyle = event.getProperty();
    String colorName =
        colorPlusStyle.substring(
            0, colorPlusStyle.length() - ColorsPreferencePage.BOLD_SUFFIX.length());
    Token token = (Token) tokenMap.get(colorName);
    LToken lToken = (LToken) tokenMap.get(colorName + MARK_SUFFIX);
    if (token == null && lToken == null) return;
    Object value = event.getNewValue();
    bold = ((Boolean) value).booleanValue();

    Object data = token.getData();
    if (data instanceof TextAttribute) {
      TextAttribute oldAttr = (TextAttribute) data;
      TextAttribute newAttr =
          new TextAttribute(
              oldAttr.getForeground(), oldAttr.getBackground(), bold ? SWT.BOLD : SWT.NORMAL);
      boolean isBold = (oldAttr.getStyle() == SWT.BOLD);
      if (isBold != bold) {
        token.setData(newAttr);
        if (lToken != null) lToken.setData(newAttr);
      }
    }
  }
Пример #12
0
 @Override
 public void propertyChange(final PropertyChangeEvent event) {
   final String property = event.getProperty();
   if (property.equals(PREF_DETAIL_PANE_FONT) || property.equals(JFaceResources.DEFAULT_FONT)) {
     dispose();
   }
 }
Пример #13
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
   */
  public void propertyChange(PropertyChangeEvent event) {
    if (event == null || !(event.getSource() instanceof IMemoryRendering)) {
      return;
    }

    // Do not handle any property changed event as the
    // sync service is being enabled.
    // Otheriwse, current sync info provider may overwrite
    // sync info unexpectedly.  We want to sync with the rendering
    // that is last changed.
    if (fEnableState == ENABLING) return;

    IMemoryRendering rendering = ((IMemoryRendering) event.getSource());
    IMemoryBlock memoryBlock = rendering.getMemoryBlock();
    String propertyId = event.getProperty();
    Object value = event.getNewValue();

    if (DEBUG_SYNC_SERVICE) {
      System.out.println("SYNC SERVICE RECEIVED CHANGED EVENT:"); // $NON-NLS-1$
      System.out.println("Source:  " + rendering); // $NON-NLS-1$
      System.out.println("Property:  " + propertyId); // $NON-NLS-1$
      System.out.println("Value:  " + value); // $NON-NLS-1$

      if (value instanceof BigInteger) {
        System.out.println("Value in hex:  " + ((BigInteger) value).toString(16)); // $NON-NLS-1$
      }
    }

    if (memoryBlock == null) return;

    if (propertyId == null) return;

    // find the synchronize info object for the memory block
    SynchronizeInfo info = (SynchronizeInfo) fSynchronizeInfo.get(memoryBlock);

    // if info is not available, need to create one to hold the property
    if (info == null) {
      info = new SynchronizeInfo(memoryBlock);
      fSynchronizeInfo.put(memoryBlock, info);
    }

    // get the value of the property
    Object oldValue = info.getProperty(propertyId);

    if (oldValue == null) {
      // if the value has never been added to the info object
      // set the property and fire a change event
      info.setProperty(propertyId, value);
      fLastChangedRendering = rendering;
      firePropertyChanged(event);
      return;
    } else if (!oldValue.equals(value)) {
      // if the value has changed
      // set the property and fire a change event
      info.setProperty(propertyId, value);
      fLastChangedRendering = rendering;
      firePropertyChanged(event);
    }
  }
Пример #14
0
 /** {@inheritDoc} */
 public void propertyChange(final PropertyChangeEvent event) {
   if (event.getProperty().equals("useWorkspaceAsRoot")) {
     if (event.getNewValue() instanceof Boolean) {
       _onlyWorkSpace = (Boolean) event.getNewValue();
       convertFileExtensions();
     }
   }
 }
 public void propertyChange(PropertyChangeEvent event) {
   if (event.getProperty() == PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS) {
     this.status = CJDTConfigSettings.isAnalyzeAnnotationsEnabled();
     if (this.action != null) {
       this.action.setChecked(this.status);
     }
   }
 }
Пример #16
0
 @Override
 public void propertyChange(PropertyChangeEvent event) {
   if (tableViewer != null) {
     if (FontPreferencePage.BASE_FONT_KEY.equals(event.getProperty())) {
       updateTableFont();
     }
   }
 }
Пример #17
0
 @Override
 public void propertyChange(PropertyChangeEvent event) {
   if (event.getProperty().equals(IGdbDebugPreferenceConstants.PREF_HIDE_RUNNING_THREADS)) {
     fHideRunningThreadsProperty = (Boolean) event.getNewValue();
     // Refresh the debug view to take in consideration this change
     getDMVMProvider().refresh();
   }
 }
Пример #18
0
 public void propertyChange(PropertyChangeEvent event) {
   if (EDTUIPreferenceConstants.EDITOR_HANDLE_DYNAMIC_PROBLEMS.equals(event.getProperty())) {
     boolean enable = fModel.shouldEnableDynamicProblems();
     fModel.setIsHandlingDynamicProblems(enable);
     if (enable == true && isEditorActive()) {
       forceReconciling(false);
     }
   }
 }
  protected void handlePropertyChange(PropertyChangeEvent event) {
    if (event != null) {
      String prefKey = event.getProperty();
      if (PreferenceConstants.EDITOR_NORMAL_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_BOUNDARYMARKER_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_STMT_BOUNDARYMARKER_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_VARIABLE_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_STRING_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_COMMENT_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_PHPDOC_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_NUMBER_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_KEYWORD_COLOR.equals(prefKey)
          || PreferenceConstants.EDITOR_TASK_COLOR.equals(prefKey)) {
        addTextAttribute(prefKey);
      } else if (PreferenceConstants.getEnabledPreferenceKey(
                  PreferenceConstants.EDITOR_NORMAL_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(
                  PreferenceConstants.EDITOR_BOUNDARYMARKER_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(
                  PreferenceConstants.EDITOR_STMT_BOUNDARYMARKER_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_BLOCKNAME_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_HASH_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_VARIABLE_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_STRING_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_KEYWORD_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_COMMENT_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_PHPDOC_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_NUMBER_COLOR)
              .equals(prefKey)
          || PreferenceConstants.getEnabledPreferenceKey(PreferenceConstants.EDITOR_TASK_COLOR)
              .equals(prefKey)) {
        boolean enabled = getColorPreferences().getBoolean(prefKey);
        prefKey = prefKey.split("\\.")[1];
        if (enabled) {
          addTextAttribute(prefKey);
        } else {
          addDefaultTextAttribute(prefKey);
        }
      }
    } else {
      loadColors();
    }

    if (fRecHighlighter != null) {
      fRecHighlighter.refreshDisplay();
    }
  }
 public void propertyChange(final PropertyChangeEvent event) {
   if (event.getProperty() == ISynchronizeModelElement.BUSY_PROPERTY) {
     Object source = event.getSource();
     if (source instanceof ISynchronizeModelElement)
       updateBusyState(
           (ISynchronizeModelElement) source,
           ((Boolean) event.getNewValue()).booleanValue());
   }
 }
Пример #21
0
 public void propertyChange(PropertyChangeEvent event) {
   if (isAlive()) {
     if (event.getProperty() == ColorChooser.PROP_COLORCHANGE) {
       RGB rgb = fColorChooser.getColorValue();
       String newColor = ColorFactory.convertRGBToString(rgb);
       if (!newColor.equals(fDiagramModelObject.getFillColor())) {
         getCommandStack().execute(new FillColorCommand(fDiagramModelObject, newColor));
       }
     } else if (event.getProperty() == ColorChooser.PROP_COLORDEFAULT) {
       // If user pref to save color is set then save the value, otherwise save as null
       String rgbValue = null;
       if (Preferences.STORE.getBoolean(IPreferenceConstants.SAVE_USER_DEFAULT_COLOR)) {
         Color color = ColorFactory.getDefaultFillColor(fDiagramModelObject);
         rgbValue = ColorFactory.convertColorToString(color);
       }
       getCommandStack().execute(new FillColorCommand(fDiagramModelObject, rgbValue));
     }
   }
 }
 private void doWorkingSetChanged(PropertyChangeEvent event) {
   String property = event.getProperty();
   if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property)) updateTitle();
   else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) {
     updateTitle();
     fViewer.getControl().setRedraw(false);
     fViewer.refresh();
     fViewer.getControl().setRedraw(true);
   }
 }
Пример #23
0
  protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
    String p = event.getProperty();

    if (p.equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)
        || p.equals(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)) {
      updateBackgroundColor();
    } else if (textTools.affectsBehavior(event)) {
      invalidateTextPresentation();
    }
  }
Пример #24
0
  public void propertyChange(PropertyChangeEvent event) {
    // When the
    String property = event.getProperty();
    if (PyTitlePreferencesPage.isTitlePreferencesProperty(property)) {

      Job job =
          new Job("Invalidate title") {

            @Override
            protected IStatus run(IProgressMonitor monitor) {
              try {
                List<IEditorReference> currentEditorReferences;
                do {
                  currentEditorReferences = getCurrentEditorReferences();
                  synchronized (this) {
                    try {
                      Thread.sleep(200);
                    } catch (InterruptedException e) {
                      // ignore.
                    }
                  }
                } while (PydevPlugin.isAlive()
                    && currentEditorReferences == null); // stop trying if the plugin is stopped;

                if (currentEditorReferences != null) {
                  final List<IEditorReference> refs = currentEditorReferences;
                  RunInUiThread.sync(
                      new Runnable() {

                        public void run() {
                          for (final IEditorReference iEditorReference : refs) {
                            final IEditorPart editor = iEditorReference.getEditor(true);
                            if (editor instanceof PyEdit) {
                              try {
                                invalidateTitle((PyEdit) editor, iEditorReference.getEditorInput());
                              } catch (PartInitException e) {
                                // ignore
                              }
                            }
                          }
                        }
                      });
                }

              } finally {
                jobPool.removeJob(this);
              }
              return Status.OK_STATUS;
            }
          };
      job.setPriority(Job.SHORT);
      jobPool.addJob(job);
    }
  }
Пример #25
0
 @Override
 public void propertyChange(PropertyChangeEvent event) {
   for (SourceRenderer rnd : m_renderers) {
     rnd.onPropertiesChanged(event);
   }
   String property = event.getProperty();
   if (property.equals(FontKey.CODE.getPreferenceName())) {
     applyItemHeight();
     getGrid().getColumn(CodeViewerColumn.LINE_NO.ordinal()).pack();
   }
   getGrid().redraw();
 }
Пример #26
0
 public void propertyChange(PropertyChangeEvent event) {
   CustomFilters customFilters = weakCustomFilter.get();
   if (customFilters == null) {
     IPreferenceStore prefs = PydevPlugin.getDefault().getPreferenceStore();
     prefs.removePropertyChangeListener(this);
   } else {
     String property = event.getProperty();
     if (property.equals(PySetupCustomFilters.CUSTOM_FILTERS_PREFERENCE_NAME)) {
       customFilters.update((String) event.getNewValue());
     }
   }
 }
Пример #27
0
 @Override
 public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
   IPreferenceStore preferences = (IPreferenceStore) event.getSource();
   if (UIActivator.PREFS_SHOW_TOOLTIPS.equals(event.getProperty())) {
     viewer.setShowTooltips(preferences.getBoolean(UIActivator.PREFS_SHOW_TOOLTIPS));
   }
   if (UIActivator.PREFS_SHOW_SCALE_TOOLTIPS.equals(event.getProperty())) {
     viewer.setShowScaleTooltips(
         preferences.getBoolean(UIActivator.PREFS_SHOW_SCALE_TOOLTIPS));
   }
   if (UIActivator.PREFS_CROSSHAIR_ACTIVATION.equals(event.getProperty())) {
     viewer.setCrosshairMode(preferences.getInt(UIActivator.PREFS_CROSSHAIR_ACTIVATION));
   }
   if (UIActivator.PREFS_CROSSHAIR_SUMMARY_TOOLTIP.equals(event.getProperty())) {
     viewer.setDecoratorSummaryTooltips(
         preferences.getBoolean(UIActivator.PREFS_CROSSHAIR_SUMMARY_TOOLTIP));
   }
   if (UIActivator.PREFS_CHART_PERIODS.equals(event.getProperty())) {
     updatePeriodActions();
   }
 }
Пример #28
0
 public void propertyChange(PropertyChangeEvent event) {
   String property = event.getProperty();
   if (IThemeManager.CHANGE_CURRENT_THEME.equals(property)
       || THEME_DiffAddBackgroundColor.equals(property)
       || THEME_DiffAddForegroundColor.equals(property)
       || THEME_DiffHunkBackgroundColor.equals(property)
       || THEME_DiffHunkForegroundColor.equals(property)
       || THEME_DiffRemoveBackgroundColor.equals(property)
       || THEME_DiffRemoveForegroundColor.equals(property)) {
     refreshDiffColors();
     refreshStyleRanges();
   }
 }
Пример #29
0
  /**
   * Changes the configuration of the given content assistant according to the given property change
   * event and the given preference store.
   *
   * @param assistant the content assistant
   * @param store the preference store
   * @param event the property change event
   */
  public static void changeConfiguration(
      ContentAssistant assistant, IPreferenceStore store, PropertyChangeEvent event) {
    String p = event.getProperty();
    if (EDTUIPreferenceConstants.CODEASSIST_AUTOACTIVATION.equals(p)) {
      boolean enabled = store.getBoolean(EDTUIPreferenceConstants.CODEASSIST_AUTOACTIVATION);
      assistant.enableAutoActivation(enabled);
    }

    if (EDTUIPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY.equals(p)) {
      int delayTime = store.getInt(EDTUIPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY);
      assistant.setAutoActivationDelay(delayTime);
    }
  }
Пример #30
0
  @Override
  public void propertyChange(PropertyChangeEvent event) {
    super.propertyChange(event);
    if (event.getProperty().equals(FieldEditor.VALUE)) {
      checkState();
    }

    if (event.getSource() == localTemplateEditor) {
      Activator.getDefault()
          .getIReportTemplateDirectoryService()
          .setDirectory((String) event.getNewValue());
    }
  }