org.eclipse.jface.preference.PreferenceConverter Java Examples

The following examples show how to use org.eclipse.jface.preference.PreferenceConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RegionViewFactory.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void initializeFromPreferences(View view) {
	super.initializeFromPreferences(view);
	IPreferenceStore store = (IPreferenceStore) getPreferencesHint()
			.getPreferenceStore();
	if (store == null) {
		return;
	}

	// Create region default styles
	ShapeStyle style = (ShapeStyle) view
			.getStyle(NotationPackage.Literals.SHAPE_STYLE);
	RGB fillRGB = PreferenceConverter.getColor(store,
			StatechartPreferenceConstants.PREF_REGION_BACKGROUND);
	style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
	RGB lineRGB = PreferenceConverter.getColor(store,
			StatechartPreferenceConstants.PREF_REGION_LINE);
	style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
}
 
Example #2
Source File: AbstractJavaScanner.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void addToken(String colorKey, String boldKey, String italicKey, String strikethroughKey, String underlineKey) {
	if (fColorManager != null && colorKey != null && fColorManager.getColor(colorKey) == null) {
		RGB rgb= PreferenceConverter.getColor(fPreferenceStore, colorKey);
		if (fColorManager instanceof IColorManagerExtension) {
			IColorManagerExtension ext= (IColorManagerExtension) fColorManager;
			ext.unbindColor(colorKey);
			ext.bindColor(colorKey, rgb);
		}
	}

	if (!fNeedsLazyColorLoading)
		fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey)));
	else {
		Token token= fTokenMap.get(colorKey);
		if (token != null)
			token.setData(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey));
	}
}
 
Example #3
Source File: JavaUIPreferenceInitializer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Sets the default value and fires a property
 * change event if necessary.
 *
 * @param store	the preference store
 * @param key the preference key
 * @param newValue the new value
 * @param fireEvent <code>false</code> if no event should be fired
 * @since 3.4
 */
private static void setDefault(IPreferenceStore store, String key, RGB newValue, boolean fireEvent) {
	if (!fireEvent) {
		PreferenceConverter.setDefault(store, key, newValue);
		return;
	}

	RGB oldValue= null;
	if (store.isDefault(key))
		oldValue= PreferenceConverter.getDefaultColor(store, key);

	PreferenceConverter.setDefault(store, key, newValue);

	if (oldValue != null && !oldValue.equals(newValue))
		store.firePropertyChangeEvent(key, oldValue, newValue);
}
 
Example #4
Source File: CustomActivity2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
	if (preferenceStore instanceof IPreferenceStore) {
		if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {

			return FigureUtilities.RGBToInteger(new RGB(44,109,163));

		} else if (feature == NotationPackage.eINSTANCE
				.getFontStyle_FontColor()) {

			return FigureUtilities.RGBToInteger(PreferenceConverter
					.getColor((IPreferenceStore) preferenceStore,
							IPreferenceConstants.PREF_FONT_COLOR));

		} else if (feature == NotationPackage.eINSTANCE
				.getFillStyle_FillColor()) {

			return FigureUtilities.RGBToInteger(new RGB(184,185,218));

		}
	}

	return getStructuralFeatureValue(feature);
}
 
Example #5
Source File: SourceViewerInformationControl.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void initializeColors() {
	IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
	RGB bgRGB;
	if (store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
		bgRGB= getVisibleBackgroundColor(fShell.getDisplay());
	} else {
		bgRGB= PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
	}
	if (bgRGB != null) {
		fBackgroundColor= new Color(fShell.getDisplay(), bgRGB);
		fIsSystemBackgroundColor= false;
	} else {
		fBackgroundColor= fShell.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
		fIsSystemBackgroundColor= true;
	}
}
 
Example #6
Source File: CustomServiceTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example #7
Source File: JavaSourceViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates a color from the information stored in the given preference store.
 * Returns <code>null</code> if there is no such information available.
 *
 * @param store the store to read from
 * @param key the key used for the lookup in the preference store
 * @param display the display used create the color
 * @return the created color according to the specification in the preference store
 * @since 3.0
 */
private Color createColor(IPreferenceStore store, String key, Display display) {

    RGB rgb= null;

    if (store.contains(key)) {

        if (store.isDefault(key))
            rgb= PreferenceConverter.getDefaultColor(store, key);
        else
            rgb= PreferenceConverter.getColor(store, key);

        if (rgb != null)
            return new Color(display, rgb);
    }

    return null;
}
 
Example #8
Source File: CustomSendTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example #9
Source File: CustomTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
    final Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
    if (preferenceStore instanceof IPreferenceStore) {
        if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
            return FigureUtilities.RGBToInteger(new RGB(44, 109, 163));
        } else if (feature == NotationPackage.eINSTANCE
                .getFontStyle_FontColor()) {
            return FigureUtilities.RGBToInteger(PreferenceConverter
                    .getColor((IPreferenceStore) preferenceStore,
                            IPreferenceConstants.PREF_FONT_COLOR));
        } else if (feature == NotationPackage.eINSTANCE
                .getFillStyle_FillColor()) {
            return FigureUtilities.RGBToInteger(new RGB(184, 185, 218));
        }
    }

    return getStructuralFeatureValue(feature);
}
 
Example #10
Source File: ExpressionBuilder.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates a color from the information stored in the given preference
 * store. Returns <code>null</code> if there is no such information
 * available.
 */
private Color createColor( IPreferenceStore store, String key,
		Display display )
{
	RGB rgb = null;
	if ( store.contains( key ) )
	{
		if ( store.isDefault( key ) )
		{
			rgb = PreferenceConverter.getDefaultColor( store, key );
		}
		else
		{
			rgb = PreferenceConverter.getColor( store, key );
		}
		if ( rgb != null )
		{
			return new Color( display, rgb );
		}
	}
	return null;
}
 
Example #11
Source File: CustomReceiveTask2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
       Object preferenceStore = getDiagramPreferencesHint().getPreferenceStore();
       if (preferenceStore instanceof IPreferenceStore) {
           if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(44,109,163));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFontStyle_FontColor()) {
               
               return FigureUtilities.RGBToInteger(PreferenceConverter
                   .getColor((IPreferenceStore) preferenceStore,
                       IPreferenceConstants.PREF_FONT_COLOR));
               
           } else if (feature == NotationPackage.eINSTANCE
               .getFillStyle_FillColor()) {
               
               return FigureUtilities.RGBToInteger(new RGB(184,185,218));
               
           }
       }

       return getStructuralFeatureValue(feature);
   }
 
Example #12
Source File: UIUtil.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public static Color createColor( IPreferenceStore store, String key,
		Display display )
{
	RGB rgb = null;
	if ( store.contains( key ) )
	{
		if ( store.isDefault( key ) )
		{
			rgb = PreferenceConverter.getDefaultColor( store, key );
		}
		else
		{
			rgb = PreferenceConverter.getColor( store, key );
		}
		if ( rgb != null )
		{
			return new Color( display, rgb );
		}
	}
	return null;
}
 
Example #13
Source File: AutoStartup.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void earlyStartup() {
	GamaPreferences.Modeling.EDITOR_BASE_FONT.init(() -> getDefaultFontData()).onChange(font -> {
		try {
			final FontData newValue = new FontData(font.getName(), font.getSize(), font.getStyle());
			setValue(EditorsPlugin.getDefault().getPreferenceStore(), TEXT_FONT, newValue);
		} catch (final Exception e) {}
	});
	GamaPreferences.Modeling.EDITOR_BACKGROUND_COLOR.init(() -> getDefaultBackground()).onChange(c -> {
		final RGB rgb = new RGB(c.getRed(), c.getGreen(), c.getBlue());
		PreferenceConverter.setValue(EditorsPlugin.getDefault().getPreferenceStore(),
				AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, rgb);
		GamaPreferences.Modeling.OPERATORS_MENU_SORT
				.onChange(newValue -> OperatorsReferenceMenu.byName = newValue.equals("Name"));
	});
	GamlRuntimeModule.staticInitialize();
	GamlEditorBindings.install();
	GamlReferenceSearch.install();
}
 
Example #14
Source File: PythonSourceViewer.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Updates the viewer's font to match the preferences.
 */
private void updateViewerFont() {
    IPreferenceStore store = getPreferenceStore();
    if (store != null) {
        FontData data = null;
        if (store.contains(JFaceResources.TEXT_FONT) && !store.isDefault(JFaceResources.TEXT_FONT)) {
            data = PreferenceConverter.getFontData(store, JFaceResources.TEXT_FONT);
        } else {
            data = PreferenceConverter.getDefaultFontData(store, JFaceResources.TEXT_FONT);
        }
        if (data != null) {
            Font font = new Font(getTextWidget().getDisplay(), data);
            applyFont(font);
            if (getFont() != null) {
                getFont().dispose();
            }
            setFont(font);
            return;
        }
    }
    // if all the preferences failed
    applyFont(JFaceResources.getTextFont());
}
 
Example #15
Source File: ViewerColorUpdater.java    From goclipse with Eclipse Public License 1.0 6 votes vote down vote up
protected Color createColor(IPreferenceStore store, String key, Display display) {
	
	RGB rgb = null;
	
	if(store.contains(key)) {
		
		if(store.isDefault(key)) {
			rgb = PreferenceConverter.getDefaultColor(store, key);
		} else {
			rgb = PreferenceConverter.getColor(store, key);
		}
		
		if(rgb != null)
			return new Color(display, rgb);
	}
	
	return null;
}
 
Example #16
Source File: LogFileViewer.java    From LogViewer with Eclipse Public License 2.0 6 votes vote down vote up
public LogFileViewer(Composite parent, int style) {
    store = LogViewerPlugin.getDefault().getPreferenceStore();
    if (store.getBoolean(ILogViewerConstants.PREF_WORD_WRAP))
        style |= SWT.WRAP;
    showWhenUpdated = store.getBoolean(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED);
    showTopOfFile = store.getBoolean(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE);
    txtViewer = new SourceViewer(parent,null,style);
    FontData[] fontData = PreferenceConverter.getFontDataArray(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE);
    if(fontData == null) {
        fontData = JFaceResources.getDefaultFont().getFontData();
    }
    txtViewer.getTextWidget().setFont(new Font(Display.getCurrent(),fontData));
    propertyChangeListener = new PropertyChangeListener();
    store.addPropertyChangeListener(propertyChangeListener);
    createCursorLinePainter();
    createAndInstallPresentationReconciler();
}
 
Example #17
Source File: AbstractDynamicNotationHandler.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
protected void updatePreferences() {
	IPreferenceStore store = SimulationActivator.getDefault().getPreferenceStore();
	// read out the new colors
	RGB foregroundColor = PreferenceConverter.getColor(store, STATE_FOREGROUND_HIGHLIGHTING_COLOR);
	RGB backgroundColor = PreferenceConverter.getColor(store, STATE_BACKGROUND_HIGHLIGHTING_COLOR);
	RGB vertexForegroundColor = PreferenceConverter.getColor(store, VERTEX_FOREGROUND_TRANSIENT_COLOR);
	RGB vertexBackgroundColor = PreferenceConverter.getColor(store, VERTEX_BACKGROUND_TRANSIENT_COLOR);
	RGB transitionColor = PreferenceConverter.getColor(store, TRANSITION_HIGHLIGHTING_COLOR);

	// Set the new colors
	STATE_HIGHLIGHT_PARAMS.foregroundFadingColor = new Color(Display.getDefault(), foregroundColor);
	STATE_HIGHLIGHT_PARAMS.backgroundFadingColor = new Color(Display.getDefault(), backgroundColor);
	SUSPENDED_PARAMS.backgroundFadingColor = STATE_HIGHLIGHT_PARAMS.backgroundFadingColor;
	SUSPENDED_PARAMS.foregroundFadingColor = green;
	VERTEX_TRANSIENT_PARAMS.foregroundFadingColor = new Color(Display.getDefault(), vertexForegroundColor);
	VERTEX_TRANSIENT_PARAMS.backgroundFadingColor = new Color(Display.getDefault(), vertexBackgroundColor);
	TRANSITION_PARAMS.foregroundFadingColor = new Color(Display.getDefault(), transitionColor);
}
 
Example #18
Source File: AbstractEditorConfigScanner.java    From editorconfig-eclipse with Apache License 2.0 6 votes vote down vote up
private void addToken(String colorKey, String boldKey, String italicKey, String strikethroughKey,
		String underlineKey) {
	if (fColorManager != null && colorKey != null && fColorManager.getColor(colorKey) == null) {
		RGB rgb = PreferenceConverter.getColor(fPreferenceStore, colorKey);
		IColorManager ext = (IColorManager) fColorManager;
		ext.unbindColor(colorKey);
		ext.bindColor(colorKey, rgb);
	}

	if (!fNeedsLazyColorLoading)
		fTokenMap.put(colorKey,
				new Token(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey)));
	else {
		Token token = fTokenMap.get(colorKey);
		if (token != null)
			token.setData(createTextAttribute(colorKey, boldKey, italicKey, strikethroughKey, underlineKey));
	}
}
 
Example #19
Source File: EditorAppearanceColorsComponent.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public void setValues(String colorPrefValue, boolean useSystemDefaultPrefValue) {
	color = StringConverter.asRGB(colorPrefValue, PreferenceConverter.COLOR_DEFAULT_DEFAULT);
	useSystemDefault = false;
	if(useSystemDefaultKey != null) {
		useSystemDefault = useSystemDefaultPrefValue;
	}
}
 
Example #20
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createANDGateway_2009(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ANDGatewayEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5019 = createLabel(node, ProcessVisualIDRegistry.getType(ANDGatewayLabelEditPart.VISUAL_ID));
	label5019.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5019 = (Location) label5019.getLayoutConstraint();
	location5019.setX(0);
	location5019.setY(5);
	return node;
}
 
Example #21
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createStartTimerEvent_3016(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(StartTimerEvent2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5031 = createLabel(node, ProcessVisualIDRegistry.getType(StartTimerEventLabel2EditPart.VISUAL_ID));
	label5031.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5031 = (Location) label5031.getLayoutConstraint();
	location5031.setX(0);
	location5031.setY(5);
	return node;
}
 
Example #22
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createScriptTask_2028(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(ScriptTaskEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5016 = createLabel(node, ProcessVisualIDRegistry.getType(ScriptTaskLabelEditPart.VISUAL_ID));
	return node;
}
 
Example #23
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createIntermediateCatchMessageEvent_2013(EObject domainElement, View containerView, int index,
		boolean persisted, PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(IntermediateCatchMessageEventEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5041 = createLabel(node,
			ProcessVisualIDRegistry.getType(IntermediateCatchMessageEventLabelEditPart.VISUAL_ID));
	label5041.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5041 = (Location) label5041.getLayoutConstraint();
	location5041.setX(0);
	location5041.setY(5);
	return node;
}
 
Example #24
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createIntermediateThrowMessageEvent_2014(EObject domainElement, View containerView, int index,
		boolean persisted, PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(IntermediateThrowMessageEventEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5042 = createLabel(node,
			ProcessVisualIDRegistry.getType(IntermediateThrowMessageEventLabelEditPart.VISUAL_ID));
	label5042.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5042 = (Location) label5042.getLayoutConstraint();
	location5042.setX(0);
	location5042.setY(5);
	return node;
}
 
Example #25
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createIntermediateErrorCatchEvent_3029(EObject domainElement, View containerView, int index,
		boolean persisted, PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(IntermediateErrorCatchEvent2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5053 = createLabel(node,
			ProcessVisualIDRegistry.getType(IntermediateErrorCatchEventLabelEditPart.VISUAL_ID));
	label5053.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5053 = (Location) label5053.getLayoutConstraint();
	location5053.setX(0);
	location5053.setY(5);
	return node;
}
 
Example #26
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createStartErrorEvent_2033(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(StartErrorEventEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5087 = createLabel(node, ProcessVisualIDRegistry.getType(StartErrorEventLabelEditPart.VISUAL_ID));
	label5087.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5087 = (Location) label5087.getLayoutConstraint();
	location5087.setX(0);
	location5087.setY(5);
	return node;
}
 
Example #27
Source File: LogViewerPlugin.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
private void loadDefaultPluginPreferences(IPreferenceStore store) {
	store.setDefault(ILogViewerConstants.PREF_BACKLOG,ILogViewerConstants.DEFAULT_BACKLOG);
	store.setDefault(ILogViewerConstants.PREF_BUFFER,ILogViewerConstants.DEFAULT_BUFFER_CAPACITY);
	store.setDefault(ILogViewerConstants.PREF_READWAIT,ILogViewerConstants.DEFAULT_READWAIT_SIZE);
	store.setDefault(ILogViewerConstants.PREF_ENCODING,System.getProperty("file.encoding"));
	store.setDefault(ILogViewerConstants.PREF_WORD_WRAP,ILogViewerConstants.DEAFULT_WORD_WRAP);
	store.setDefault(ILogViewerConstants.PREF_SHOW_WHEN_UPDATED,ILogViewerConstants.DEAFULT_SHOW_WHEN_UPDATED);
	store.setDefault(ILogViewerConstants.PREF_FILTER_EXTENSIONS,ILogViewerConstants.DEFAULT_FILTER_EXTENSIONS);
	store.setDefault(ILogViewerConstants.PREF_SHOW_TOP_OF_FILE,ILogViewerConstants.DEAFULT_SHOW_TOP_OF_FILE);		
	PreferenceConverter.setDefault(store,ILogViewerConstants.PREF_CURSORLINE_COLOR,new RGB(192,192,192));
	PreferenceConverter.setDefault(store,ILogViewerConstants.PREF_EDITOR_FONT_STYLE,JFaceResources.getDefaultFont().getFontData());
}
 
Example #28
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createStartMessageEvent_3012(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(StartMessageEvent2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5029 = createLabel(node, ProcessVisualIDRegistry.getType(StartMessageEventLabel2EditPart.VISUAL_ID));
	label5029.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
	Location location5029 = (Location) label5029.getLayoutConstraint();
	location5029.setX(0);
	location5029.setY(5);
	return node;
}
 
Example #29
Source File: CrossflowViewProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createCsvSink_2002(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(CrossflowVisualIDRegistry.getType(CsvSinkEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5002 = createLabel(node, CrossflowVisualIDRegistry.getType(CsvSinkNameEditPart.VISUAL_ID));
	return node;
}
 
Example #30
Source File: ProcessViewProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public Node createTextAnnotation_3015(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Node node = NotationFactory.eINSTANCE.createNode();
	node.getStyles().add(NotationFactory.eINSTANCE.createDescriptionStyle());
	node.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
	node.getStyles().add(NotationFactory.eINSTANCE.createLineStyle());
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(ProcessVisualIDRegistry.getType(TextAnnotation2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	Node label5010 = createLabel(node, ProcessVisualIDRegistry.getType(TextAnnotationText2EditPart.VISUAL_ID));
	return node;
}