Example usage for org.eclipse.jface.preference IPreferenceStore getInt

List of usage examples for org.eclipse.jface.preference IPreferenceStore getInt

Introduction

In this page you can find the example usage for org.eclipse.jface.preference IPreferenceStore getInt.

Prototype

int getInt(String name);

Source Link

Document

Returns the current value of the integer-valued preference with the given name.

Usage

From source file:de.tud.cs.st.vespucci.vespucci_model.diagram.providers.VespucciViewProvider.java

License:Open Source License

/**
 * @generated/* w w w . j a  va2s.co  m*/
 */
public Edge createNotAllowed_4004(EObject domainElement, 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<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(de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry
            .getType(de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.NotAllowedEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // 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);
    }
    Node label6004 = createLabel(edge,
            de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry.getType(
                    de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.NotAllowedNameEditPart.VISUAL_ID));
    label6004.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6004 = (Location) label6004.getLayoutConstraint();
    location6004.setX(-7);
    location6004.setY(-7);
    return edge;
}

From source file:de.tud.cs.st.vespucci.vespucci_model.diagram.providers.VespucciViewProvider.java

License:Open Source License

/**
 * @generated/*from  w  ww.j  a v  a  2s  .c om*/
 */
public Edge createExpected_4002(EObject domainElement, 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<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(de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry
            .getType(de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.ExpectedEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // 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);
    }
    Node label6002 = createLabel(edge,
            de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry.getType(
                    de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.ExpectedNameEditPart.VISUAL_ID));
    label6002.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6002 = (Location) label6002.getLayoutConstraint();
    location6002.setX(-7);
    location6002.setY(-7);
    return edge;
}

From source file:de.tud.cs.st.vespucci.vespucci_model.diagram.providers.VespucciViewProvider.java

License:Open Source License

/**
 * @generated//from  www.j  a va 2 s.  c  o  m
 */
public Edge createGlobalIncoming_4006(EObject domainElement, 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<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(de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry
            .getType(de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.GlobalIncomingEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // 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);
    }
    Node label6006 = createLabel(edge,
            de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry.getType(
                    de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.GlobalIncomingNameEditPart.VISUAL_ID));
    label6006.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6006 = (Location) label6006.getLayoutConstraint();
    location6006.setX(-7);
    location6006.setY(-7);
    return edge;
}

From source file:de.tud.cs.st.vespucci.vespucci_model.diagram.providers.VespucciViewProvider.java

License:Open Source License

/**
 * @generated/* ww w  . jav  a2 s  .  c  om*/
 */
public Edge createGlobalOutgoing_4007(EObject domainElement, 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<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(de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry
            .getType(de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.GlobalOutgoingEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // 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);
    }
    Node label6007 = createLabel(edge,
            de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry.getType(
                    de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.GlobalOutgoingNameEditPart.VISUAL_ID));
    label6007.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6007 = (Location) label6007.getLayoutConstraint();
    location6007.setX(-7);
    location6007.setY(-7);
    return edge;
}

From source file:de.tud.cs.st.vespucci.vespucci_model.diagram.providers.VespucciViewProvider.java

License:Open Source License

/**
 * @generated//from w w w. j ava 2s. c  om
 */
public Edge createViolation_4009(EObject domainElement, 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<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(de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry
            .getType(de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.ViolationEditPart.VISUAL_ID));
    edge.setElement(domainElement);
    // 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);
    }
    Node label6009 = createLabel(edge,
            de.tud.cs.st.vespucci.vespucci_model.diagram.part.VespucciVisualIDRegistry.getType(
                    de.tud.cs.st.vespucci.vespucci_model.diagram.edit.parts.ViolationNameEditPart.VISUAL_ID));
    label6009.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
    Location location6009 = (Location) label6009.getLayoutConstraint();
    location6009.setX(-7);
    location6009.setY(-7);
    return edge;
}

From source file:de.unistuttgart.ipvs.pmp.editor.ui.preferences.PreferenceInitializer.java

License:Apache License

public static int getJpmppsPort() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    return store.getInt(PreferenceConstants.JPMPPS_PORT);
}

From source file:de.unistuttgart.ipvs.pmp.editor.ui.preferences.PreferenceInitializer.java

License:Apache License

public static int getJpmppsTimeout() {
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    return store.getInt(PreferenceConstants.JPMPPS_TIMEOUT);
}

From source file:de.volanakis.ribbonide.internal.presentation.RibbonPresentationFactory2.java

License:Open Source License

private int getViewMinimumCharsInTab() {
    IPreferenceStore store = PlatformUI.getPreferenceStore();
    int minChars = store.getInt(IWorkbenchPreferenceConstants.VIEW_MINIMUM_CHARACTERS);
    return Math.max(0, minChars);
}

From source file:de.walware.ecommons.preferences.ui.OverlayPreferenceStore.java

License:Open Source License

private void propagateProperty(final IPreferenceStore orgin, final OverlayStorePreference key,
        final IPreferenceStore target) {

    if (orgin.isDefault(key.fKey)) {
        if (!target.isDefault(key.fKey)) {
            target.setToDefault(key.fKey);
        }/*  w  ww .  j a  v a 2 s.  c o  m*/
        return;
    }

    final Type type = key.fType;
    switch (type) {

    case BOOLEAN: {
        final boolean originValue = orgin.getBoolean(key.fKey);
        final boolean targetValue = target.getBoolean(key.fKey);
        if (targetValue != originValue) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }

    case DOUBLE: {
        final double originValue = orgin.getDouble(key.fKey);
        final double targetValue = target.getDouble(key.fKey);
        if (targetValue != originValue) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }

    case FLOAT: {
        final float originValue = orgin.getFloat(key.fKey);
        final float targetValue = target.getFloat(key.fKey);
        if (targetValue != originValue) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }

    case INT: {
        final int originValue = orgin.getInt(key.fKey);
        final int targetValue = target.getInt(key.fKey);
        if (targetValue != originValue) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }

    case LONG: {
        final long originValue = orgin.getLong(key.fKey);
        final long targetValue = target.getLong(key.fKey);
        if (targetValue != originValue) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }

    case STRING: {
        final String originValue = orgin.getString(key.fKey);
        final String targetValue = target.getString(key.fKey);
        if (targetValue != null && originValue != null && !targetValue.equals(originValue)) {
            target.setValue(key.fKey, originValue);
        }
        break;
    }
    }
}

From source file:de.walware.ecommons.preferences.ui.OverlayPreferenceStore.java

License:Open Source License

private void loadProperty(final IPreferenceStore orgin, final OverlayStorePreference key,
        final IPreferenceStore target, final boolean forceInitialization) {

    final Type type = key.fType;
    switch (type) {

    case BOOLEAN: {
        if (forceInitialization) {
            target.setValue(key.fKey, true);
        }//  w ww . j ava 2 s. c  om
        target.setValue(key.fKey, orgin.getBoolean(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultBoolean(key.fKey));
        break;
    }

    case DOUBLE: {
        if (forceInitialization) {
            target.setValue(key.fKey, 1.0D);
        }
        target.setValue(key.fKey, orgin.getDouble(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultDouble(key.fKey));
        break;
    }

    case FLOAT: {
        if (forceInitialization) {
            target.setValue(key.fKey, 1.0F);
        }
        target.setValue(key.fKey, orgin.getFloat(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultFloat(key.fKey));
        break;
    }

    case INT: {
        if (forceInitialization) {
            target.setValue(key.fKey, 1);
        }
        target.setValue(key.fKey, orgin.getInt(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultInt(key.fKey));
        break;
    }

    case LONG: {
        if (forceInitialization) {
            target.setValue(key.fKey, 1L);
        }
        target.setValue(key.fKey, orgin.getLong(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultLong(key.fKey));
        break;
    }

    case STRING: {
        if (forceInitialization) {
            target.setValue(key.fKey, "1"); //$NON-NLS-1$
        }
        target.setValue(key.fKey, orgin.getString(key.fKey));
        target.setDefault(key.fKey, orgin.getDefaultString(key.fKey));
        break;
    }
    }
}