Java Code Examples for org.eclipse.jface.resource.JFaceResources#getResources()
The following examples show how to use
org.eclipse.jface.resource.JFaceResources#getResources() .
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: TimelineComposite.java From nebula with Eclipse Public License 2.0 | 6 votes |
public TimelineComposite(Composite parent, int style) { super(parent, style); fResourceManager = new LocalResourceManager(JFaceResources.getResources(), this); final FillLayout layout = new FillLayout(); layout.marginHeight = 10; layout.marginWidth = 10; setLayout(layout); setBackground(ColorConstants.black); final Canvas canvas = new Canvas(this, SWT.DOUBLE_BUFFERED); canvas.setBackground(ColorConstants.black); final LightweightSystem lightWeightSystem = new LightweightSystem(canvas); fRootFigure = new RootFigure(fResourceManager); fRootFigure.setFont(parent.getFont()); lightWeightSystem.setContents(fRootFigure); // draw2d does not directly support mouseWheelEvents, so register on canvas canvas.addMouseWheelListener(new TimelineScaler(this)); }
Example 2
Source File: ToolBarNavigator.java From neoscada with Eclipse Public License 1.0 | 6 votes |
public ToolBarNavigator ( final Composite parent, final int style, final ViewManager viewManager ) { this.viewManager = viewManager; this.toolbar = new ToolBar ( parent, style ); this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ) ); this.toolbar.addDisposeListener ( new DisposeListener () { @Override public void widgetDisposed ( final DisposeEvent e ) { handleDispose (); } } ); viewManager.addViewManagerListener ( this ); }
Example 3
Source File: SmartImportBdmPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public Control createControl(Composite parent, IWizardContainer wizardContainer, DataBindingContext ctx) { resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().create()); composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); super.createControl(composite, wizardContainer, ctx); Composite importComposite = createImportComposite(composite); filePathObservable.addValueChangeListener(e -> parseInput()); ctx.bindValue(WidgetProperties.visible().observe(importComposite), new ComputedValue<Boolean>() { @Override protected Boolean calculate() { return filePathObservable.getValue() != null; } }); ctx.bindValue(new WritableValue(), importBdmModelObservable, // Purpose: disable on finish button when input isn't correct UpdateStrategyFactory.neverUpdateValueStrategy().create(), UpdateStrategyFactory.updateValueStrategy() .withValidator(new SmartImportBdmModelValidator()) .create()); return composite; }
Example 4
Source File: JFaceViewerIntegrationExample.java From nebula with Eclipse Public License 2.0 | 5 votes |
public MarriedLabelProvider() { LocalResourceManager resourceMgr = new LocalResourceManager(JFaceResources.getResources()); URL checked = JFaceViewerIntegrationExample.class.getResource("images/checked.gif"); URL unchecked = JFaceViewerIntegrationExample.class.getResource("images/unchecked.gif"); this.checkedImg = resourceMgr.createImage(ImageDescriptor.createFromURL(checked)); this.uncheckedImg = resourceMgr.createImage(ImageDescriptor.createFromURL(unchecked)); }
Example 5
Source File: KeyTreeViewer.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public KeyTreeViewer ( final Composite parent ) { this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ), parent ); this.viewer = new TreeViewer ( parent ); this.viewer.getControl ().setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) ); this.viewer.setAutoExpandLevel ( AbstractTreeViewer.ALL_LEVELS ); this.contentProvider = new ObservableListTreeContentProvider ( new FactoryImpl (), null ); this.viewer.setContentProvider ( this.contentProvider ); this.viewer.setLabelProvider ( this.labelProvider = new LabelProviderImpl ( this.resourceManager, this.contentProvider.getRealizedElements () ) ); }
Example 6
Source File: WidgetMessageDecorator.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public WidgetMessageDecorator(Composite parent, Optional<String> defaultMessage) { createComposite(parent); this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); errorColor = resourceManager.createColor(ColorConstants.ERROR_RGB); warningColor = resourceManager.createColor(ColorConstants.WARNING_RGB); this.defaultMessage = defaultMessage; messageLabel = new CLabel(composite, SWT.NONE); messageLabel.setTopMargin(1); messageLabel.setLeftMargin(0); messageLabel.setFont(getMessageFont()); messageLabel.setText(defaultMessage.orElse("")); foregroundColor = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND); updateExpandState(); }
Example 7
Source File: CordovaPluginWizardResources.java From thym with Eclipse Public License 1.0 | 5 votes |
public CordovaPluginWizardResources(Display display) { this.resourceManager = new LocalResourceManager(JFaceResources.getResources(display)); this.h2FontDescriptor = createFontDescriptor(SWT.BOLD, 1.15f); this.h2ItalicFontDescriptor = createFontDescriptor(SWT.BOLD | SWT.ITALIC, 1.15f); this.subFontDescriptor = createFontDescriptor(SWT.NONE, 0.75f); this.italicFontDescriptor = createFontDescriptor(SWT.ITALIC, 1); }
Example 8
Source File: Activator.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public void start ( final BundleContext context ) throws Exception { resources = new LocalResourceManager ( JFaceResources.getResources () ); super.start ( context ); plugin = this; }
Example 9
Source File: TabbedPropertyTitle.java From birt with Eclipse Public License 1.0 | 5 votes |
private void updateToolBar( ) { if ( toolbar != null ) { ResourceManager parentResourceManager = JFaceResources.getResources( ); LocalResourceManager localManager = new LocalResourceManager( parentResourceManager ); for ( int i = 0; i < toolbar.getItemCount( ); i++ ) { ToolItem item = toolbar.getItem( i ); IAction action = (IAction) actionMap.get( item ); if ( action != null ) { ImageDescriptor image = null; if ( action.getImageDescriptor( ) != null ) image = action.getImageDescriptor( ); if ( image != null ) item.setImage( localManager.createImageWithDefault( image ) ); item.setToolTipText( action.getToolTipText( ) ); if ( IAction.AS_CHECK_BOX == action.getStyle( ) ) { item.setSelection( action.isChecked( ) ); } item.setEnabled( action.isEnabled( ) ); } } disposeOldImages( ); imageManager = localManager; if ( toolbar.isFocusControl( ) ) toolbar.setFocus( ); } }
Example 10
Source File: ManualOverride.java From neoscada with Eclipse Public License 1.0 | 5 votes |
@Override public void createPart ( final Composite parent ) { this.resourceManager = new LocalResourceManager ( JFaceResources.getResources () ); super.createPart ( parent ); }
Example 11
Source File: EditableControlWidget.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
protected EditableControlWidget(Composite parent, String id, boolean labelAbove, int horizontalLabelAlignment, int verticalLabelAlignment, int labelHint, boolean readOnly, String labelValue, String message, boolean useCompositeMessageDecorator, Optional<String> buttonLabel, Optional<FormToolkit> toolkit) { super(parent, id, labelAbove, horizontalLabelAlignment, verticalLabelAlignment, labelHint, readOnly, labelValue, message, buttonLabel, toolkit); this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent); this.useCompositeMessageDecorator = useCompositeMessageDecorator; errorColor = resourceManager.createColor(ColorConstants.ERROR_RGB); warningColor = resourceManager.createColor(ColorConstants.WARNING_RGB); }
Example 12
Source File: DataItemToolTip.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public DataItemToolTip ( final Control control, final int style, final boolean manualActivation, final Item item ) { super ( control, style, manualActivation ); this.resourceManager = new LocalResourceManager ( JFaceResources.getResources () ); this.item = item; }
Example 13
Source File: AppEngineLabelProvider.java From google-cloud-eclipse with Apache License 2.0 | 4 votes |
public AppEngineLabelProvider() { this(new LocalResourceManager(JFaceResources.getResources())); }
Example 14
Source File: SamplePart.java From codeexamples-eclipse with Eclipse Public License 1.0 | 4 votes |
@PostConstruct public void createComposite(Composite parent) { addFonts(display); ResourceManager resManager = new LocalResourceManager(JFaceResources.getResources(), parent); FontDescriptor fontDescriptor = FontDescriptor.createFrom("Roboto-ThinItalic", 11, SWT.NORMAL); Font font = resManager.createFont(fontDescriptor); parent.setLayout(new GridLayout(1, false)); txtInput = new Text(parent, SWT.BORDER); txtInput.setFont(font); txtInput.setMessage("Enter text to mark part as dirty"); txtInput.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { dirty.setDirty(true); } }); FontData fd = txtInput.getFont().getFontData()[0]; txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Text txtInput2 = new Text(parent, SWT.BORDER); txtInput2.setMessage("Enter text to mark part as dirty"); txtInput2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Button button = new Button(parent, SWT.PUSH); button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); button.setFont(font); button.setText("Press me"); Button button2 = new Button(parent, SWT.PUSH); button2.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); button2.setText("Press me"); tableViewer = new TableViewer(parent); tableViewer.setContentProvider(ArrayContentProvider.getInstance());; tableViewer.setInput(createInitialDataModel()); tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH)); }
Example 15
Source File: BoolLEDComposite.java From neoscada with Eclipse Public License 1.0 | 4 votes |
public BoolLEDComposite ( final Composite parent, final int style, final DataItemDescriptor descriptor, final String format, final boolean expectedValue, final boolean isAlarm, final boolean isOnOff, final String attribute ) { super ( parent, style, null, null ); this.resourceManager = new LocalResourceManager ( JFaceResources.getResources () ); this.imageGreen = this.resourceManager.createImageWithDefault ( ImageDescriptor.createFromFile ( BoolLEDComposite.class, "icons/ledGreen.png" ) ); //$NON-NLS-1$ this.imageGray = this.resourceManager.createImageWithDefault ( ImageDescriptor.createFromFile ( BoolLEDComposite.class, "icons/ledGray.png" ) ); //$NON-NLS-1$ this.imageRed = this.resourceManager.createImageWithDefault ( ImageDescriptor.createFromFile ( BoolLEDComposite.class, "icons/ledRed.png" ) ); //$NON-NLS-1$ this.imageOn = this.resourceManager.createImageWithDefault ( ImageDescriptor.createFromFile ( BoolLEDComposite.class, "icons/on.png" ) ); //$NON-NLS-1$ this.imageOff = this.resourceManager.createImageWithDefault ( ImageDescriptor.createFromFile ( BoolLEDComposite.class, "icons/off.png" ) ); //$NON-NLS-1$ final RowLayout layout = new RowLayout (); layout.wrap = false; layout.center = true; layout.spacing = 3; setLayout ( layout ); this.expectedValue = expectedValue; this.isAlarm = isAlarm; this.isOnOff = isOnOff; this.attribute = attribute; this.controlImage = new ControlImage ( this, this.registrationManager ); this.controlImage.setDetailItem ( descriptor.asItem () ); this.signalLabel = new Label ( this, SWT.NONE ); this.signalLabel.setImage ( this.imageGray ); new DescriptorLabel ( this, SWT.NONE, format, descriptor ); if ( descriptor != null ) { this.registrationManager.registerItem ( "value", descriptor.getItemId (), descriptor.getConnectionInformation (), false, false ); //$NON-NLS-1$ } if ( Boolean.getBoolean ( "org.eclipse.scada.developer" ) ) //$NON-NLS-1$ { if ( this.isAlarm == true ) { this.signalLabel.setToolTipText ( "Red" ); } else { this.signalLabel.setToolTipText ( "Green" ); } } }
Example 16
Source File: MenuManagerCopiedToAddCreateMenuWithMenuParent.java From Pydev with Eclipse Public License 1.0 | 4 votes |
@Override public void update(String property) { IContributionItem items[] = getItems(); for (int i = 0; i < items.length; i++) { items[i].update(property); } if (menu != null && !menu.isDisposed() && menu.getParentItem() != null) { if (IAction.TEXT.equals(property)) { String text = getOverrides().getText(this); if (text == null) { text = getMenuText(); } if (text != null) { ExternalActionManager.ICallback callback = ExternalActionManager.getInstance().getCallback(); if (callback != null) { int index = text.indexOf('&'); if (index >= 0 && index < text.length() - 1) { char character = Character.toUpperCase(text.charAt(index + 1)); if (callback.isAcceleratorInUse(SWT.ALT | character)) { if (index == 0) { text = text.substring(1); } else { text = text.substring(0, index) + text.substring(index + 1); } } } } menu.getParentItem().setText(text); } } else if (IAction.IMAGE.equals(property) && image != null) { LocalResourceManager localManager = new LocalResourceManager(JFaceResources.getResources()); menu.getParentItem().setImage(localManager.createImage(image)); disposeOldImages(); imageManager = localManager; } } }
Example 17
Source File: FilteredTypesSelectionDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public TypeItemLabelProvider() { fImageManager= new LocalResourceManager(JFaceResources.getResources()); fBoldStyler= createBoldStyler(); fBoldQualifierStyler= createBoldQualifierStyler(); }
Example 18
Source File: SingleVisualInterfaceViewPart.java From neoscada with Eclipse Public License 1.0 | 4 votes |
@Override public void createPartControl ( final Composite parent ) { this.manager = new LocalResourceManager ( JFaceResources.getResources () ); parent.setLayout ( new FillLayout () ); // selection this.selectionProvider = new AbstractSelectionProvider (); getSite ().setSelectionProvider ( this.selectionProvider ); final List<ExtensionDescriptor> extensions = Activator.getExtensionDescriptors (); final Composite wrapper = new Composite ( parent, SWT.NONE ); final GridLayout gridLayout = new GridLayout ( 3, false ); gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0; gridLayout.marginHeight = gridLayout.marginWidth = 0; wrapper.setLayout ( gridLayout ); final Composite topComposite = new Composite ( wrapper, SWT.NONE ); topComposite.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false, 3, 1 ) ); topComposite.setLayout ( createExtensionGridLayout () ); final Composite leftComposite = new Composite ( wrapper, SWT.NONE ); leftComposite.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, true ) ); leftComposite.setLayout ( createExtensionGridLayout () ); // create main this.viewHolder = new Composite ( wrapper, SWT.NONE ); this.viewHolder.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) ); this.viewHolder.setLayout ( this.stackLayout = new StackLayout () ); final Composite rightComposite = new Composite ( wrapper, SWT.NONE ); rightComposite.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, true ) ); rightComposite.setLayout ( createExtensionGridLayout () ); final Composite bottomComposite = new Composite ( wrapper, SWT.NONE ); bottomComposite.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false, 3, 1 ) ); bottomComposite.setLayout ( createExtensionGridLayout () ); try { createExtensions ( extensions, topComposite, "TOP", true ); createExtensions ( extensions, bottomComposite, "BOTTOM", true ); createExtensions ( extensions, leftComposite, "LEFT", false ); createExtensions ( extensions, rightComposite, "RIGHT", false ); } catch ( final CoreException e ) { StatusManager.getManager ().handle ( e, Activator.PLUGIN_ID ); } for ( final ViewInstanceDescriptor descriptor : this.descriptors ) { createAndAddView ( descriptor ); } activateNextMain (); }
Example 19
Source File: ChartAreaRenderer.java From neoscada with Eclipse Public License 1.0 | 4 votes |
public ChartAreaRenderer ( final Composite control ) { super ( new LocalResourceManager ( JFaceResources.getResources ( control.getDisplay () ), control ) ); this.realm = new DisplayRealm ( control.getDisplay () ); this.control = control; }
Example 20
Source File: AbstractPreferenceItem.java From dsl-devkit with Eclipse Public License 1.0 | 2 votes |
/** * Gets the image manager. * * @return the image manager */ protected ResourceManager getImageManager() { return JFaceResources.getResources(); }