/**
  * Reloads some layout relevant preferences from the PreferenceStore to include any preference
  * changes made in between.
  */
 private void reloadPrefrences() {
   IPreferenceStore prefs = VersionTreePlugin.getDefault().getPreferenceStore();
   hspacing = prefs.getInt(VersionTreePlugin.PREF_HSPACING);
   vspacing = prefs.getInt(VersionTreePlugin.PREF_VSPACING);
   height = prefs.getInt(VersionTreePlugin.PREF_ELEMENT_HEIGHT);
   width = prefs.getInt(VersionTreePlugin.PREF_ELEMENT_WIDTH);
 }
  /*
   * (non-Javadoc)
   *
   * @see com.ibm.examples.chart.widget.AbstractChartBuilder#buildChart()
   */
  protected void createChart() {
    data = adapter.getData();
    while (data.length == 0) {
      data = adapter.getData();
    }
    IPreferenceStore store = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
    xSeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_X_SERIES_TICKS);
    ySeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS);
    maxItems = store.getInt(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS);
    viewableItems = store.getInt(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS);

    chart = ChartWithAxesImpl.create();

    chart.setDimension(ChartDimension.TWO_DIMENSIONAL_LITERAL);
    chart.setType("Scatter Chart");

    // Plot
    // chart.getBlock( ).setBackground(ColorDefinitionImpl.WHITE( ) );
    //  Plot p = chart.getPlot( );
    ///  p.getClientArea( ).setBackground(GradientImpl.create( ColorDefinitionImpl.create(
    // 225,225,255 ),ColorDefinitionImpl.create( 255, 255, 225 ),-35,false ) );
    // p.getOutline( ).setVisible( true );
    // Title        cwaBar.getTitle( )                .getLabel()                .getCaption( )
    //           .setValue( "Bar Chart with        Multiple Y Series" );//$NON-NLS-1$
    // Legend
    // Legend lg = cwaBar.getLegend( );
    // lg.getText(
    // ).getFont( ).setSize( 16 );        lg.getInsets( ).set( 10, 5, 0, 0 );
    // lg.setAnchor( Anchor.NORTH_LITERAL );

  }
 public Rectangle getBounds() {
   View view = this.getNotationView();
   int width =
       ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Width()))
           .intValue();
   int height =
       ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getSize_Height()))
           .intValue();
   int x =
       ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_X()))
           .intValue();
   int y =
       ((Integer) getStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLocation_Y()))
           .intValue();
   String prefElementId = ViewUtil.resolveSemanticElement(view).eClass().getName();
   IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
   String preferenceConstantWitdh =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           view, prefElementId, PreferencesConstantsHelper.WIDTH);
   String preferenceConstantHeight =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           view, prefElementId, PreferencesConstantsHelper.HEIGHT);
   if (width <= 0) {
     width = store.getInt(preferenceConstantWitdh);
   }
   if (height <= 0) {
     height = store.getInt(preferenceConstantHeight);
   }
   return new Rectangle(x, y, width, height);
 }
 /**
  * initialize node dimension.
  *
  * @param view the element to initialize
  * @param store the preference store
  * @param elementName the name to the element
  */
 public static Dimension getDimensionFromPref(
     View view, final IPreferenceStore store, String elementName) {
   Dimension dim = new Dimension();
   String width = getpreferenceKey(view, elementName, PreferenceConstantHelper.WIDTH);
   String height = getpreferenceKey(view, elementName, PreferenceConstantHelper.HEIGHT);
   dim = new Dimension(store.getInt(width), store.getInt(height));
   return dim;
 }
  /**
   * initialize the routing for a graphical element
   *
   * @param view the element to initialize
   * @param store the preference store
   * @param elementName the name to the element
   */
  public static void initRoutingFromPrefs(
      View view, final IPreferenceStore store, String elementName) {
    if (!usePreferenceInitializer(view)) {
      return;
    }

    Routing routing =
        Routing.get(
            store.getInt(
                getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_STYLE)));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Smoothness smoothness =
        Smoothness.get(
            store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.SMOOTHNESS)));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), smoothness);
    }
    JumpLinkStatus jumpLinkStatus =
        JumpLinkStatus.get(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_STATUS));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), jumpLinkStatus);
    }

    JumpLinkType jumpLinkType =
        JumpLinkType.get(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_TYPE));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), jumpLinkType);
    }
    boolean jumpLinksReverse =
        store.getBoolean(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_REVERSE));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), jumpLinksReverse);

    boolean routingObstruction =
        store.getBoolean(
            getpreferenceKey(
                view, elementName, PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), routingObstruction);

    boolean routingDistance =
        store.getBoolean(
            getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_DISTANCE));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), routingDistance);
  }
 private int getPreferenceColourMapChoice() {
   IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
   // try to retrieve setting from last session
   int i =
       preferenceStore.getInt(
           getPartName() + "." + PreferenceConstants.PLOT_VIEW_PLOT2D_COLOURMAP);
   if (i != 0) return i;
   return preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_PLOT2D_COLOURMAP)
       ? preferenceStore.getDefaultInt(PreferenceConstants.PLOT_VIEW_PLOT2D_COLOURMAP)
       : preferenceStore.getInt(PreferenceConstants.PLOT_VIEW_PLOT2D_COLOURMAP);
 }
 /** @generated */
 protected NodeFigure createNodePlate() {
   String prefElementId = "InstanceSpecification";
   IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
   String preferenceConstantWitdh =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
   String preferenceConstantHeight =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
   DefaultSizeNodeFigure result =
       new DefaultSizeNodeFigure(
           store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
   return result;
 }
Beispiel #8
0
  public void startup() {
    loadState();
    loadCommentHistory();
    loadCommentTemplates();
    CVSProviderPlugin.getPlugin()
        .addRepositoryListener(
            new ICVSListener() {
              public void repositoryAdded(ICVSRepositoryLocation root) {
                rootAdded(root);
              }

              public void repositoryRemoved(ICVSRepositoryLocation root) {
                rootRemoved(root);
              }
            });

    IPreferenceStore store = CVSUIPlugin.getPlugin().getPreferenceStore();
    store.addPropertyChangeListener(
        new IPropertyChangeListener() {

          public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(ICVSUIConstants.PREF_COMMIT_COMMENTS_MAX_HISTORY)) {
              Object newValue = event.getNewValue();
              if (newValue instanceof String) {
                try {
                  setMaxComments(Integer.parseInt((String) newValue));
                } catch (NumberFormatException e) {
                  // fail silently
                }
              }
            }
          }
        });
    setMaxComments(store.getInt(ICVSUIConstants.PREF_COMMIT_COMMENTS_MAX_HISTORY));
  }
 /** @generated */
 protected NodeFigure createNodePlate() {
   String prefElementId = "OutputPin";
   IPreferenceStore store = UMLDiagramEditorPlugin.getInstance().getPreferenceStore();
   String preferenceConstantWitdh =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           getNotationView(), prefElementId, PreferencesConstantsHelper.WIDTH);
   String preferenceConstantHeight =
       PreferenceInitializerForElementHelper.getpreferenceKey(
           getNotationView(), prefElementId, PreferencesConstantsHelper.HEIGHT);
   DefaultSizeNodeFigure result =
       new DefaultSizeNodeFigure(
           store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
   // FIXME: workaround for #154536
   result.getBounds().setSize(result.getPreferredSize());
   return result;
 }
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.presentations.AbstractPresentationFactory#createViewPresentation(org.eclipse.swt.widgets.Composite,
   *      org.eclipse.ui.presentations.IStackPresentationSite)
   */
  public StackPresentation createViewPresentation(Composite parent, IStackPresentationSite site) {

    DefaultTabFolder folder =
        new DefaultTabFolder(
            parent,
            viewTabPosition | SWT.BORDER,
            site.supportsState(IStackPresentationSite.STATE_MINIMIZED),
            site.supportsState(IStackPresentationSite.STATE_MAXIMIZED));

    final IPreferenceStore store = PlatformUI.getPreferenceStore();
    final int minimumCharacters =
        store.getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS);
    if (minimumCharacters >= 0) {
      folder.setMinimumCharacters(minimumCharacters);
    }

    PresentablePartFolder partFolder = new PresentablePartFolder(folder);

    folder.setUnselectedCloseVisible(false);
    folder.setUnselectedImageVisible(true);

    TabbedStackPresentation result =
        new TabbedStackPresentation(site, partFolder, new StandardViewSystemMenu(site));

    DefaultThemeListener themeListener = new DefaultThemeListener(folder, result.getTheme());
    result.getTheme().addListener(themeListener);

    // RAP [bm]: not needed as tab style does not change
    //		new DefaultSimpleTabListener(result.getApiPreferences(),
    //				IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
    //				folder);
    // RAPEND: [bm]

    return result;
  }
 /** @generated */
 public Edge createViewTableViewedTables_3002(
     View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
   Edge edge = NotationFactory.eINSTANCE.createEdge();
   edge.getStyles().add(NotationFactory.eINSTANCE.createRoutingStyle());
   edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
   RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
   ArrayList points = new ArrayList(2);
   points.add(new RelativeBendpoint());
   points.add(new RelativeBendpoint());
   bendpoints.setPoints(points);
   edge.setBendpoints(bendpoints);
   ViewUtil.insertChildView(containerView, edge, index, persisted);
   edge.setType(SqlmodelVisualIDRegistry.getType(ViewTableViewedTables2EditPart.VISUAL_ID));
   edge.setElement(null);
   // initializePreferences
   final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();
   FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
   if (edgeFontStyle != null) {
     FontData fontData =
         PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
     edgeFontStyle.setFontName(fontData.getName());
     edgeFontStyle.setFontHeight(fontData.getHeight());
     edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
     edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
     org.eclipse.swt.graphics.RGB fontRGB =
         PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
     edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
   }
   Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
   if (routing != null) {
     ViewUtil.setStructuralFeatureValue(
         edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
   }
   return edge;
 }
  /** @generated */
  public Edge createAssociation_4001(
      EObject domainElement,
      View containerView,
      int index,
      boolean persisted,
      PreferencesHint preferencesHint) {
    Connector edge = NotationFactory.eINSTANCE.createConnector();
    edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
    RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
    ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
    points.add(new RelativeBendpoint());
    points.add(new RelativeBendpoint());
    bendpoints.setPoints(points);
    edge.setBendpoints(bendpoints);
    ViewUtil.insertChildView(containerView, edge, index, persisted);
    edge.setType(
        edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part
            .NECSIS14_ClassDiagramVisualIDRegistry.getType(
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts
                .AssociationEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // initializePreferences
    final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

    org.eclipse.swt.graphics.RGB lineRGB =
        PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_LINE_COLOR);
    ViewUtil.setStructuralFeatureValue(
        edge,
        NotationPackage.eINSTANCE.getLineStyle_LineColor(),
        FigureUtilities.RGBToInteger(lineRGB));
    FontStyle edgeFontStyle = (FontStyle) edge.getStyle(NotationPackage.Literals.FONT_STYLE);
    if (edgeFontStyle != null) {
      FontData fontData =
          PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
      edgeFontStyle.setFontName(fontData.getName());
      edgeFontStyle.setFontHeight(fontData.getHeight());
      edgeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
      edgeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
      org.eclipse.swt.graphics.RGB fontRGB =
          PreferenceConverter.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
      edgeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
    }
    Routing routing = Routing.get(prefStore.getInt(IPreferenceConstants.PREF_LINE_STYLE));
    if (routing != null) {
      ViewUtil.setStructuralFeatureValue(
          edge, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
    }
    Node label6001 =
        createLabel(
            edge,
            edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part
                .NECSIS14_ClassDiagramVisualIDRegistry.getType(
                edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.edit.parts
                    .AssociationNameEditPart.VISUAL_ID));
    label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6001 = (Location) label6001.getLayoutConstraint();
    location6001.setX(0);
    location6001.setY(40);
    return edge;
  }
  private void restoreState() {

    _isUpdateUI = true;
    {
      _chkIsSynchSmoothing.setSelection( //
          _prefStore.getBoolean(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_IS_SYNCH_SMOOTHING));

      // repeated smoothing
      _spinnerRepeatedSmoothing.setSelection( //
          _prefStore.getInt(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_REPEATED_SMOOTHING));
      _spinnerRepeatedTau.setSelection( //
          (int)
              (_prefStore.getDouble(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_REPEATED_TAU) * 10));

      // altitude
      _chkIsAltitudeSmoothing.setSelection( //
          _prefStore.getBoolean(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_IS_ALTITUDE));

      // gradient
      _spinnerGradientTau.setSelection( //
          (int)
              (_prefStore.getDouble(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_GRADIENT_TAU) * 10));

      // pulse
      _chkIsPulseSmoothing.setSelection( //
          _prefStore.getBoolean(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_IS_PULSE));
      _spinnerPulseTau.setSelection( //
          (int) (_prefStore.getDouble(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_PULSE_TAU) * 10));

      // speed
      _spinnerSpeedTau.setSelection( //
          (int) (_prefStore.getDouble(ITourbookPreferences.GRAPH_JAMET_SMOOTHING_SPEED_TAU) * 10));
    }
    _isUpdateUI = false;
  }
Beispiel #14
0
 public static String ws() {
   IPreferenceStore store = Activator.getDefault().getPreferenceStore();
   return store.getString(WS.key)
       + "://"
       + store.getString(HOST.key)
       + ":"
       + store.getInt(WS_PORT.key);
 }
 /** @return thumbnail size */
 private int getPreferenceImageSize() {
   IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
   int size =
       preferenceStore.isDefault(PreferenceConstants.IMAGEEXPLORER_IMAGESIZE)
           ? preferenceStore.getDefaultInt(PreferenceConstants.IMAGEEXPLORER_IMAGESIZE)
           : preferenceStore.getInt(PreferenceConstants.IMAGEEXPLORER_IMAGESIZE);
   return size;
 }
  private void restoreState() {

    _spinnerRecentTags.setSelection( //
        _prefStore.getInt(ITourbookPreferences.APPEARANCE_NUMBER_OF_RECENT_TAGS));

    _spinnerRecentTourTypes.setSelection( //
        _prefStore.getInt(ITourbookPreferences.APPEARANCE_NUMBER_OF_RECENT_TOUR_TYPES));

    _chkAutoOpenTagging.setSelection(
        _prefStore.getBoolean(ITourbookPreferences.APPEARANCE_IS_TAGGING_AUTO_OPEN));
    _chkTaggingAnimation.setSelection(
        _prefStore.getBoolean(ITourbookPreferences.APPEARANCE_IS_TAGGING_ANIMATION));
    _spinnerAutoOpenDelay.setSelection(
        _prefStore.getInt(ITourbookPreferences.APPEARANCE_TAGGING_AUTO_OPEN_DELAY));

    _chkMemMonitor.setSelection(
        _prefStore.getBoolean(ITourbookPreferences.APPEARANCE_SHOW_MEMORY_MONITOR));
  }
  private void createTangoHost() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();

    final StringBuffer buf = new StringBuffer();
    buf.append(store.getString(CommonUIPreferenceConstants.SERVER_NAME));
    buf.append(":");
    buf.append(store.getInt(CommonUIPreferenceConstants.SERVER_PORT));
    System.setProperty("TANGO_HOST", buf.toString());
  }
Beispiel #18
0
 private double getPreferenceAutoContrastLo() {
   IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
   int v =
       preferenceStore.isDefault(PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST_LOTHRESHOLD)
           ? preferenceStore.getDefaultInt(
               PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST_LOTHRESHOLD)
           : preferenceStore.getInt(PreferenceConstants.PLOT_VIEW_PLOT2D_AUTOCONTRAST_LOTHRESHOLD);
   return v / 100.0;
 }
 private double getPreferenceAutoContrastHi() {
   IPreferenceStore preferenceStore = AnalysisRCPActivator.getDefault().getPreferenceStore();
   int v =
       preferenceStore.isDefault(PreferenceConstants.IMAGEEXPLORER_AUTOCONTRAST_HITHRESHOLD)
           ? preferenceStore.getDefaultInt(
               PreferenceConstants.IMAGEEXPLORER_AUTOCONTRAST_HITHRESHOLD)
           : preferenceStore.getInt(PreferenceConstants.IMAGEEXPLORER_AUTOCONTRAST_HITHRESHOLD);
   return v / 100.0;
 }
 public HyperlinkDetectorDelegate(
     HyperlinkDetectorDescriptor descriptor, IPreferenceStore preferenceStore) {
   this.descriptor = descriptor;
   if (preferenceStore != null) {
     stateMask =
         preferenceStore.getInt(
             descriptor.getId() + HyperlinkDetectorDescriptor.STATE_MASK_POSTFIX);
     enabled = !preferenceStore.getBoolean(descriptor.getId());
   }
 }
  @Before
  public void setUp() {

    // store pref values
    this.defaultIsGroupEnable =
        store.getDefaultBoolean(CommonPreferencesConstants.PREF_GROUP_ENABLE);
    this.isGroupEnable = store.getBoolean(CommonPreferencesConstants.PREF_GROUP_ENABLE);

    this.defaultIsGroupByContainingFeature =
        store.getDefaultBoolean(CommonPreferencesConstants.PREF_GROUP_BY_CONTAINING_FEATURE);
    this.isGroupByContainingFeature =
        store.getBoolean(CommonPreferencesConstants.PREF_GROUP_BY_CONTAINING_FEATURE);

    this.defaultGroupSize = store.getDefaultInt(CommonPreferencesConstants.PREF_GROUP_SIZE);
    this.groupSize = store.getInt(CommonPreferencesConstants.PREF_GROUP_SIZE);

    this.defaultGroupTrigger = store.getDefaultInt(CommonPreferencesConstants.PREF_GROUP_TRIGGER);
    this.groupTrigger = store.getInt(CommonPreferencesConstants.PREF_GROUP_TRIGGER);
  }
  /** Constructs a well renderer model with default properties. */
  public WellRendererModel() {
    super();

    // Initialize the default renderer settings from the preferences.
    final IPreferenceStore preferences = WellRendererPreferencePage.PREFERENCE_STORE;

    final int boreRadius = preferences.getInt(WELL_BORE_RADIUS);
    final RGB boreColor = PreferenceConverter.getColor(preferences, WELL_BORE_COLOR);

    _size = addIntegerProperty(WELL_BORE_RADIUS, boreRadius);
    _color = addColorProperty(WELL_BORE_COLOR, boreColor);
  }
  @Override
  protected void initializeFromPreferences(View view) {
    super.initializeFromPreferences(view);

    IPreferenceStore store = (IPreferenceStore) getPreferencesHint().getPreferenceStore();
    if (store == null) {
      return;
    }

    // Get default size from preferences use set view size.
    String preferenceConstantWitdh =
        PreferenceInitializerForElementHelper.getpreferenceKey(
            view, view.getType(), PreferenceConstantHelper.WIDTH);
    String preferenceConstantHeight =
        PreferenceInitializerForElementHelper.getpreferenceKey(
            view, view.getType(), PreferenceConstantHelper.HEIGHT);
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getSize_Width(), store.getInt(preferenceConstantWitdh));
    ViewUtil.setStructuralFeatureValue(
        view, NotationPackage.eINSTANCE.getSize_Height(), store.getInt(preferenceConstantHeight));
  }
Beispiel #24
0
  public SpellQA() {
    // 确定检查类别
    IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    isHunspell = preferenceStore.getBoolean(QAConstant.QA_PREF_isHunspell);
    ignoreNontrans = preferenceStore.getBoolean(QAConstant.QA_PREF_ignoreNontrans);
    ignoreDigitalFirst = preferenceStore.getBoolean(QAConstant.QA_PREF_ignoreDigitalFirst);
    ignoreUpperCaseFirst = preferenceStore.getBoolean(QAConstant.QA_PREF_ignoreUpperCaseFirst);

    qaPreferenceStore = Activator.getDefault().getPreferenceStore();
    tipLevel = qaPreferenceStore.getInt(QAConstant.QA_PREF_spell_TIPLEVEL);
    // UNDO 拼写检查的信息提示太过专业化,详细化提示。比如:qa.spellCheck.HashDictionary.tip1=词典文件缺少表格大小。
  }
Beispiel #25
0
 private void restoreLayoutState(IMemento memento) {
   if (memento == null) {
     // read state from the preference store
     IPreferenceStore store = DLTKUIPlugin.getDefault().getPreferenceStore();
     fCurrViewState = store.getInt(this.getViewSite().getId() + TAG_VIEW_STATE);
   } else {
     // restore from memento
     Integer integer = memento.getInteger(this.getViewSite().getId() + TAG_VIEW_STATE);
     if ((integer == null) || !isValidState(integer.intValue())) {
       fCurrViewState = LIST_VIEW_STATE;
     } else fCurrViewState = integer.intValue();
   }
 }
  /**
   * 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);
    }
  }
    public CustomContext(ContextFactory factory) {
      super(factory);
      try {
        IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
        timeout = preferenceStore.getInt(PreferenceConstants.P_TIMEOUT);
      } catch (Throwable t) {
        System.err.println(t.getMessage());
      }

      if (timeout == 0) {
        timeout = PreferenceConstants.P_TIMEOUT_DEFAULT;
      }
      // System.out.println("timeout=" + timeout + " @" + this);
    }
 private void load() {
   projectBase.setText(prefStore.getString(PreferenceConstants.BASE_RISK_FACTOR));
   for (int i = 0; i < markers.size(); ++i) {
     impacts
         .get(i)
         .select(
             prefStore.getInt(ProblemNameToPreferenceMapper.nameSmellImpact(markers.get(i))) - 1);
     baselines
         .get(i)
         .setText(
             prefStore.getString(ProblemNameToPreferenceMapper.nameSmellBaseLine(markers.get(i))));
   }
   updateApplyButton();
 }
  /**
   * initialize label location.
   *
   * @param view the element to initialize
   * @param store the preference store
   * @param elementName the name to the element
   */
  public static void initLabelLocationFromPrefs(
      View view, final IPreferenceStore store, String elementName) {
    assert (view instanceof Node);

    Node label = (Node) view;
    Location location = (Location) label.getLayoutConstraint();

    String xKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_X);
    String yKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_Y);

    location.setX(store.getInt(xKey));
    location.setY(store.getInt(yKey));

    label.setLayoutConstraint(location);
  }
Beispiel #30
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.ptp.ui.preferences.AbstractPreferencePage#setValues()
  */
 @Override
 protected void setValues() {
   IPreferenceStore store = getPreferenceStore();
   String backend = store.getString(SDMPreferenceConstants.PREFS_SDM_BACKEND);
   int index = sdmBackendCombo.indexOf(backend);
   if (index >= 0) {
     sdmBackendCombo.select(index);
   }
   sdmPathText.setText(store.getString(SDMPreferenceConstants.PREFS_SDM_PATH + backend));
   sdmBackendPathText.setText(
       store.getString(SDMPreferenceConstants.PREFS_SDM_BACKEND_PATH + backend));
   debugEnabled = store.getBoolean(SDMPreferenceConstants.SDM_DEBUG_ENABLED);
   debugLevel = store.getInt(SDMPreferenceConstants.SDM_DEBUG_LEVEL);
   updateDebugButtons();
 }