コード例 #1
0
 private void valueChanged(final boolean on, boolean store) {
   setChecked(on);
   if (store) {
     ContextUiPlugin.getDefault().getPreferenceStore().setValue(PREF_ID, on);
   }
   ContextUiPlugin.getDefault().getPreferenceStore().setValue(PREF_INTERSECTION_MODE, true);
 }
コード例 #2
0
  public ToggleDecorateInterestLevelAction() {
    super();
    setText(Messages.ToggleDecorateInterestLevelAction_Decorate_Interest);
    setToolTipText(Messages.ToggleDecorateInterestLevelAction_Toggle_Interest_Level_Decorator);

    boolean checked = ContextUiPlugin.getDefault().getPreferenceStore().getBoolean(PREF_ID);
    valueChanged(checked, false);
  }
コード例 #3
0
  @Override
  protected boolean isPreservedFilter(ViewerFilter filter) {
    if (filter instanceof CoreExpressionFilter) {
      CoreExpressionFilter expressionFilter = (CoreExpressionFilter) filter;

      Set<String> preservedIds =
          ContextUiPlugin.getDefault().getPreservedFilterIds(viewPart.getSite().getId());
      if (!preservedIds.isEmpty()) {
        try {
          Expression expression2 = (Expression) filterExpressionField1.get(expressionFilter);

          for (CommonFilterDescriptor commonFilterDescriptor : filterDescriptors) {
            if (preservedIds.contains(commonFilterDescriptor.getId())) {
              Expression expression1 =
                  (Expression) filterExpressionField2.get(commonFilterDescriptor);
              if (expression1 != null && expression1.equals(expression2)) {
                return true;
              }
            }
          }
        } catch (IllegalArgumentException e) {
          StatusHandler.log(
              new Status(
                  IStatus.ERROR,
                  ResourcesUiBridgePlugin.ID_PLUGIN,
                  "Could not determine filter",
                  e)); //$NON-NLS-1$
        } catch (IllegalAccessException e) {
          StatusHandler.log(
              new Status(
                  IStatus.ERROR,
                  ResourcesUiBridgePlugin.ID_PLUGIN,
                  "Could not determine filter",
                  e)); //$NON-NLS-1$
        }
      }
    }
    return false;
  }