Java Code Examples for org.eclipse.swt.custom.CLabel#setImage()
The following examples show how to use
org.eclipse.swt.custom.CLabel#setImage() .
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: AbstractSortableHeader.java From nebula with Eclipse Public License 2.0 | 6 votes |
private void makeMouseAdapter() { this.sortMouseAdapter = new MouseAdapter() { public void mouseDown(MouseEvent e) { CLabel label = (CLabel) e.widget; int c = labels.indexOf(label); if (c != lastSortColumn) { sortDescending = null; sortIndicator = null; } lastSortColumn = c; sortOnColumn(c, toggleSortDirection()); for (int i = 0; i < labels.size(); i++) { CLabel labelToSet = (CLabel) labels.get(i); if (i != c) { labelToSet.setImage(null); } else { labelToSet.setImage(sortIndicator); } } } }; }
Example 2
Source File: CreateContractInputFromBusinessObjectWizardPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private void createReminderText(final EMFDataBindingContext dbc, final Composite composite) { final CLabel reminder = new CLabel(composite, SWT.NONE); final Display d = Display.getCurrent(); final Image img = d.getSystemImage(SWT.ICON_WARNING); reminder.setImage(img); reminder.setLayoutData(GridDataFactory.fillDefaults().hint(600, SWT.DEFAULT).create()); final Button autoGeneratedOperationButton = new Button(composite, SWT.RADIO); final Button manuallyDefinedOperationButton = new Button(composite, SWT.RADIO); actionObservable = new SelectObservableValue<>(Boolean.class); actionObservable.addOption(Boolean.TRUE, WidgetProperties.selection().observe(autoGeneratedOperationButton)); actionObservable.addOption(Boolean.FALSE, WidgetProperties.selection().observe(manuallyDefinedOperationButton)); if (contract.eContainer() instanceof Task) { reminder.setText(Messages.reminderForStepMessage); autoGeneratedOperationButton.setText(Messages.autoGeneratedOperationStepButton); manuallyDefinedOperationButton.setText(Messages.manuallyDefinedOperationStepButton); } else { reminder.setText(Messages.reminderForProcessMessage); autoGeneratedOperationButton.setText(Messages.autoGeneratedOperationProcessButton); manuallyDefinedOperationButton.setText(Messages.manuallyDefinedOperationProcessButton); } dbc.bindValue(actionObservable, generationOptions.getAutoGeneratedScriptObservable()); }
Example 3
Source File: TmfEventsTableHeader.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
private void toggle() { fCollapsed = !fCollapsed; for (Control child : getChildren()) { if (child instanceof CLabel) { CLabel label = (CLabel) child; if (fCollapsed) { label.setImage(null); label.setToolTipText(label.getText()); label.setText(null); label.setMargins(DEFAULT_MARGIN, 0, COLLAPSED_RIGHT_MARGIN, 0); } else { label.setImage(DELETE); label.setText(label.getToolTipText()); label.setToolTipText((String) label.getData(TOOLTIP_KEY)); label.setMargins(DEFAULT_MARGIN, DEFAULT_MARGIN, DEFAULT_MARGIN, DEFAULT_MARGIN); } } } getParent().layout(); }
Example 4
Source File: ViewFilterDialog.java From tracecompass with Eclipse Public License 2.0 | 6 votes |
private void createCLabels(Composite parent, Composite labels, String currentRegex) { CLabel filter = new CLabel(labels, SWT.BORDER); filter.setText(currentRegex); filter.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE)); filter.setBackground(fColorScheme.getColor(TimeGraphColorScheme.TOOL_BACKGROUND)); filter.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e2) { deleteCLabel(parent, filter, e2); } }); parent.layout(); Rectangle bounds = parent.getShell().getBounds(); Point size = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT); Rectangle trim = parent.getShell().computeTrim(0, 0, size.x, size.y); parent.getShell().setBounds(bounds.x + bounds.width - trim.width, bounds.y + bounds.height - trim.height, trim.width, trim.height); }
Example 5
Source File: BonitaCompareEditorInput.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public Control createContents(final Composite parent) { final CLabel label = new CLabel(parent, SWT.NONE); final String lastArgumentWithConditionOrNot = canBeContainedInScript ? " " + Messages.reviewChangesMessageWithConditionPlace : ""; if (operationType == RefactoringOperationType.UPDATE) { if (elementName.equals(newName)) { label.setText(Messages.bind(Messages.reviewTypeChangesMessageRefactoring, new String[] { elementName, lastArgumentWithConditionOrNot })); } else { label.setText(Messages.bind(Messages.reviewChangesMessageRefactoring, new String[] { elementName, newName, lastArgumentWithConditionOrNot })); } } else { label.setText(Messages.bind(Messages.reviewChangesMessageRemoving, elementName, lastArgumentWithConditionOrNot)); } label.setImage(Display.getCurrent().getSystemImage(SWT.ICON_WARNING)); return super.createContents(parent); }
Example 6
Source File: DeployRequiredControl.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
public DeployRequiredControl(Composite parent, AbstractBdmFormPage formPage, GridData gridData) { super(parent, SWT.NONE); setLayout(GridLayoutFactory.fillDefaults().create()); setLayoutData(gridData); formPage.getToolkit().adapt(this); Group group = new Group(this, SWT.NONE); group.setLayout(GridLayoutFactory.fillDefaults().create()); group.setLayoutData(GridDataFactory.fillDefaults().create()); CLabel label = new CLabel(group, SWT.WRAP); label.setLayoutData(GridDataFactory.fillDefaults().create()); label.setText(Messages.bdmDeployRequired); label.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING)); boolean show = formPage.getEditorContribution().observeDeployRequired().getValue(); gridData.exclude = !show; setVisible(show); }
Example 7
Source File: SmartImportBdmPage.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private Composite createImportComposite(Composite parent) { Composite composite = new Composite(parent, SWT.None); composite.setLayout(GridLayoutFactory.fillDefaults().margins(10, 0).create()); composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); createHeader(composite); Composite viewerComposite = new Composite(composite, SWT.None); viewerComposite.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create()); viewerComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); CLabel previewDescLabel = new CLabel(viewerComposite, SWT.None); previewDescLabel.setLayoutData(GridDataFactory.fillDefaults().create()); Image icon = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO); previewDescLabel.setImage(icon); previewDescLabel.setText(Messages.previewDesc); createMergeViewer(viewerComposite); return composite; }
Example 8
Source File: ChartLegend.java From olca-app with Mozilla Public License 2.0 | 6 votes |
private void element(String text, Object model, int colorIndex) { if (model instanceof CategorizedDescriptor || model instanceof CategorizedEntity) { ImageHyperlink link = new ImageHyperlink(composite, SWT.TOP); link.setText(text); link.setImage(getImage(colorIndex)); Controls.onClick(link, (e) -> { if (model instanceof CategorizedDescriptor) { App.openEditor((CategorizedDescriptor) model); } else if (model instanceof CategorizedEntity) { App.openEditor((CategorizedEntity) model); } }); createdLinks.push(link); } else { CLabel label = new CLabel(composite, SWT.TOP); label.setImage(getImage(colorIndex)); label.setText(text); createdLinks.push(label); } }
Example 9
Source File: Widgets.java From olca-app with Mozilla Public License 2.0 | 5 votes |
public static CLabel readOnly(Composite parent, String label, Image image, String property, ModelEditor<?> editor, FormToolkit toolkit) { UI.formLabel(parent, label); CLabel labelWidget = new CLabel(parent, SWT.NONE); GridData gridData = UI.gridData(labelWidget, false, false); gridData.verticalAlignment = SWT.TOP; gridData.verticalIndent = 2; labelWidget.setImage(image); editor.getBinding().readOnly(editor.getModel(), property, labelWidget); new CommentControl(parent, toolkit, property, editor.getComments()); return labelWidget; }
Example 10
Source File: ContractConstraintExpressionWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void createControl(final Composite parent) { final EMFDataBindingContext context = new EMFDataBindingContext(); final Composite container = new Composite(parent, SWT.NONE); container.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).create()); final Composite editorContainer = new Composite(container, SWT.NONE); editorContainer.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); editorContainer.setLayout(new FillLayout()); final GroovyViewer viewer = createSourceViewer(editorContainer); getSourceViewer().getTextWidget().setData(ContractInputCompletionProposalComputer.INPUTS, inputs); getSourceViewer().getDocument().addDocumentListener(this); expressionContentObservable = EMFObservables.observeValue(constraint, ProcessPackage.Literals.CONTRACT_CONSTRAINT__EXPRESSION); final IObservableList inputsObservable = EMFObservables.observeList(constraint, ProcessPackage.Literals.CONTRACT_CONSTRAINT__INPUT_NAMES); inputIndexer = new ConstraintInputIndexer(constraint, inputs, viewer.getGroovyCompilationUnit()); getSourceViewer().getDocument().set(expressionContentObservable.getValue().toString()); context.addValidationStatusProvider( new ConstraintExpressionEditorValidator(expressionContentObservable, inputsObservable)); final CLabel contentAssistHint = new CLabel(container, SWT.NONE); contentAssistHint.setLayoutData(GridDataFactory.fillDefaults().align(SWT.END, SWT.FILL).create()); contentAssistHint.setText(Messages.contentAssistHint); contentAssistHint.setImage(Pics.getImage(PicsConstants.hint)); setControl(container); WizardPageSupport.create(this, context); }
Example 11
Source File: DomainStatusLabel.java From statecharts with Eclipse Public License 1.0 | 5 votes |
protected void createLabel(DomainStatus status) { label = new CLabel(this, SWT.NONE); label.setFont(DOMAIN_STATUS_FONT); label.setBackground(ColorConstants.white); label.setForeground(getSeverityColor(status.getSeverity())); label.setImage(getSeverityImage(status.getSeverity())); }
Example 12
Source File: HistogramView.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
private void updateLegendArea() { for (Control c: fLegendArea.getChildren()) { c.dispose(); } disposeLegendImages(); if (fFullTraceHistogram.showTraces()) { Collection<ITmfTrace> traces = TmfTraceManager.getTraceSet(fTrace); fLegendImages = new Image[traces.size()]; int traceIndex = 0; for (ITmfTrace trace : traces) { fLegendImages[traceIndex] = new Image(fLegendArea.getDisplay(), 16, 16); GC gc = new GC(fLegendImages[traceIndex]); gc.setBackground(fFullTraceHistogram.getTraceColor(traceIndex)); gc.fillRectangle(0, 0, 15, 15); gc.setForeground(fLegendArea.getDisplay().getSystemColor(SWT.COLOR_BLACK)); gc.drawRectangle(0, 0, 15, 15); gc.dispose(); CLabel label = new CLabel(fLegendArea, SWT.NONE); label.setText(trace.getName()); label.setImage(fLegendImages[traceIndex]); traceIndex++; } } fLegendArea.layout(); fLegendArea.getParent().layout(); }
Example 13
Source File: XYGraphConfigDialog.java From nebula with Eclipse Public License 2.0 | 5 votes |
private void addMaxWarningMessage(Composite composite, String type) { final CLabel warning = new CLabel(composite, SWT.NONE); warning.setText("There are too many " + type + " to edit"); warning.setToolTipText("Currently only the first " + MAX_CONFIG_PAGE_COUNT + " " + type + " can have their properties manually edited.\n" + "This is due to a limitation with the current widget design on the configure form.\n" + "Please see Bug 514179 for more details."); warning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); warning.setImage(XYGraphMediaFactory.getInstance().getImage("images/warning.png")); }
Example 14
Source File: AggregationDialog.java From birt with Eclipse Public License 1.0 | 4 votes |
private void createSubTotalArea( Composite content ) { CLabel subTotalLabel = new CLabel( content, SWT.NONE ); subTotalLabel.setText( Messages.getString( "AggregationDialog.Label.Sub" ) ); //$NON-NLS-1$ if ( axis == ICrosstabConstants.ROW_AXIS_TYPE ) { subTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROW_SUB_TOTAL_IMAGE ) ); } else if ( axis == ICrosstabConstants.COLUMN_AXIS_TYPE ) { subTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMN_SUB_TOTAL_IMAGE ) ); } Table table = new Table( content, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.CHECK ); table.setLinesVisible( false ); table.setHeaderVisible( true ); GridData gd = new GridData( GridData.FILL_BOTH ); gd.minimumHeight = 200; table.setLayoutData( gd ); subTableViewer = new CheckboxTableViewer( table ); SubTotalProvider provider = new SubTotalProvider( subTableViewer,crosstab,axis ); String[] columnNames = provider.getColumnNames( ); int[] columnWidths = provider.columnWidths( ); for ( int i = 0; i < columnNames.length; i++ ) { TableColumn column = new TableColumn( table, SWT.LEFT ); column.setText( columnNames[i] ); column.setWidth( columnWidths[i] ); } subTableViewer.setUseHashlookup( true ); subTableViewer.setColumnProperties( provider.getColumnNames( ) ); subTableViewer.setCellEditors( provider.getCellEditors( ) ); subTableViewer.setContentProvider( provider ); subTableViewer.setLabelProvider( provider ); subTableViewer.setCellModifier( provider ); }
Example 15
Source File: AggregationDialog.java From birt with Eclipse Public License 1.0 | 4 votes |
private void createGrandTotalArea( Composite content ) { CLabel grandTotalLabel = new CLabel( content, SWT.NONE ); grandTotalLabel.setText( Messages.getString( "AggregationDialog.Label.Grand" ) ); //$NON-NLS-1$ if ( axis == ICrosstabConstants.ROW_AXIS_TYPE ) { grandTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROW_GRAND_TOTAL_IMAGE ) ); } else if ( axis == ICrosstabConstants.COLUMN_AXIS_TYPE ) { grandTotalLabel.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMN_GRAND_TOTAL_IMAGE ) ); } Table table = new Table( content, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.CHECK ); table.setLinesVisible( false ); table.setHeaderVisible( true ); GridData gd = new GridData( GridData.FILL_BOTH ); gd.minimumHeight = 200; table.setLayoutData( gd ); grandTableViewer = new CheckboxTableViewer( table ); GrandTotalProvider provider = new GrandTotalProvider( grandTableViewer,crosstab, axis ); String[] columnNames = provider.getColumnNames( ); int[] columnWidths = provider.columnWidths( ); for ( int i = 0; i < columnNames.length; i++ ) { TableColumn column = new TableColumn( table, SWT.LEFT ); column.setText( columnNames[i] ); column.setWidth( columnWidths[i] ); } grandTableViewer.setUseHashlookup( true ); grandTableViewer.setColumnProperties( provider.getColumnNames( ) ); grandTableViewer.setCellEditors( provider.getCellEditors( ) ); grandTableViewer.setCellModifier( provider ); grandTableViewer.setCellEditors( provider.getCellEditors() ); grandTableViewer.setContentProvider( provider ); grandTableViewer.setLabelProvider( provider ); grandTableViewer.setCellModifier( provider ); }
Example 16
Source File: SmartImportBdmPage.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
private void createHeader(Composite parent) { Group composite = new Group(parent, SWT.NONE); composite.setLayout(GridLayoutFactory.fillDefaults().spacing(LayoutConstants.getSpacing().x, 2).extendedMargins(0, 0, -5, 0).create()); composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); CLabel warning = new CLabel(composite, SWT.WRAP); warning.setLayoutData(GridDataFactory.fillDefaults().exclude(true).create()); Image warningIcon = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING); warning.setImage(warningIcon); CLabel info1 = new CLabel(composite, SWT.WRAP); info1.setLayoutData(GridDataFactory.fillDefaults().exclude(true).create()); info1.setImage(BusinessObjectPlugin.getImage("icons/arrow16.png")); CLabel info2 = new CLabel(composite, SWT.WRAP); info2.setLayoutData(GridDataFactory.fillDefaults().exclude(true).create()); info2.setImage(BusinessObjectPlugin.getImage("icons/arrow16.png")); importBdmModelObservable.addValueChangeListener(e -> { SmartImportBdmModel newModel = e.diff.getNewValue(); if (newModel == null) { updateCLabel(warning, "", false); updateCLabel(info1, "", false); updateCLabel(info2, "", false); } else if (bdmFileStore == null) { updateCLabel(warning, "", false); updateCLabel(info1, "", false); updateCLabel(info2, Messages.newBdmImport, true); } else if (isSameContent(newModel)) { updateCLabel(warning, "", false); updateCLabel(info1, "", false); updateCLabel(info2, Messages.globalSkipped, true); } else if (isConflicting(newModel)) { if (newModel instanceof OverwriteImportBdmModel) { updateCLabel(warning, Messages.smartImportImpossible, true); updateCLabel(info1, Messages.overwriteImportDesc, true); updateCLabel(info2, "", false); } else { updateCLabel(warning, Messages.smartImportConflict, true); updateCLabel(info1, Messages.selectPackageToKeep, true); updateCLabel(info2, Messages.smartImportDesc, true); } } else { updateCLabel(warning, "", false); updateCLabel(info1, "", false); updateCLabel(info2, Messages.smartImportDesc, true); } parent.layout(true); }); }
Example 17
Source File: WizardNewHybridProjectCreationPage.java From thym with Eclipse Public License 1.0 | 4 votes |
public void createControl(Composite parent ){ super.createControl(parent); Group applicationGroup = new Group((Composite)getControl(), SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; applicationGroup.setLayout(layout); applicationGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); applicationGroup.setText("Mobile Application"); Label lblName = new Label(applicationGroup, SWT.NONE); lblName.setText("Name:"); txtName = new Text(applicationGroup, SWT.BORDER); txtName.addModifyListener(propertyModifyListener); txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); txtName.setMessage("a friendly name"); Label lblId = new Label(applicationGroup, SWT.NONE); lblId.setText("ID:"); txtID = new Text(applicationGroup, SWT.BORDER); txtID.setMessage("com.mycom.app"); txtID.addModifyListener(propertyModifyListener); txtID.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); createWorkingSetGroup(); Group cordovaGroup = new Group((Composite)getControl(), SWT.NONE); cordovaGroup.setText("Cordova version"); layout = new GridLayout(); layout.numColumns = 1; cordovaGroup.setLayout(layout); cordovaGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); cordovaLabel = new CLabel(cordovaGroup, SWT.NONE); cordovaLabel.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING)); cordovaLabel.setText("Checking cordova availability..."); cordovaLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL,true, true, 1, 1)); setErrorMessage(null); setMessage(null); setPageComplete(validatePage()); Dialog.applyDialogFont(getControl()); checkCordovaIsAvailable(); }
Example 18
Source File: MigrationWarningWizardPage.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override public void createControl(Composite parent) { final Composite mainComposite = new Composite(parent, SWT.NONE); mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).extendedMargins(10, 5, 0, 0).create()); mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); final Label textArea = new Label(mainComposite, SWT.WRAP ); textArea.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).hint(600, SWT.DEFAULT).create()); textArea.setText(Messages.bind(Messages.importWarningMessageContent, new Object[]{bosProductName})); final Composite captionComposite = new Composite(mainComposite,SWT.NONE); captionComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(10,15).create()); captionComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); final CLabel noActionRequiredLabel = new CLabel(captionComposite,SWT.WRAP); noActionRequiredLabel.setText(Messages.noActionRequiredHelp); noActionRequiredLabel.setImage(Pics.getImage("valid.png",MigrationPlugin.getDefault())); noActionRequiredLabel.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).create()); final CLabel reviewRequiredLabel = new CLabel(captionComposite,SWT.WRAP); reviewRequiredLabel.setText(Messages.reviewRequiredHelp); reviewRequiredLabel.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); reviewRequiredLabel.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).create()); final CLabel actionRequiredLabel = new CLabel(captionComposite,SWT.WRAP); actionRequiredLabel.setText(Messages.actionRequiredHelp); actionRequiredLabel.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK)); actionRequiredLabel.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).create()); final Label textArea2 = new Label(mainComposite, SWT.WRAP ); textArea2.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).hint(600, SWT.DEFAULT).create()); textArea2.setText(Messages.importWarningMessageContentAfterPart); final Composite buttonComposite = new Composite(mainComposite,SWT.NONE); buttonComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).create()); buttonComposite.setLayoutData(GridDataFactory.swtDefaults().grab(true, true).create()); final Button displayCheckbox = new Button(buttonComposite, SWT.CHECK); displayCheckbox.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).indent(0, 10).align(SWT.BEGINNING, SWT.BOTTOM).create()); displayCheckbox.setText(Messages.doNotDisplayAtNextImport); displayCheckbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { MigrationPlugin.getDefault().getPreferenceStore().setValue(BarImporterPreferenceConstants.DISPLAY_MIGRATION_WARNING, !displayCheckbox.getSelection()); } }); displayCheckbox.setSelection(!MigrationPlugin.getDefault().getPreferenceStore().getBoolean(BarImporterPreferenceConstants.DISPLAY_MIGRATION_WARNING)); setControl(mainComposite); }
Example 19
Source File: ViewerPane.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
/** * Sets the receiver's title image. * @param image the image */ public void setImage(Image image) { CLabel cl= (CLabel) getTopLeft(); cl.setImage(image); }
Example 20
Source File: DataWizardPage.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
protected void createDataOptions(final Composite parent) { new Label(parent, SWT.NONE); // FILLER final Composite composite = new Composite(parent, SWT.NONE); composite.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).grab(true, false).create()); composite.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).margins(0, 0).spacing(25, 0).create()); multiplicityButton = new Button(composite, SWT.CHECK); multiplicityButton.setLayoutData(GridDataFactory.fillDefaults().create()); multiplicityButton.setText(Messages.isMultiple); final ControlDecoration multiplicityControlDecoration = new ControlDecoration(multiplicityButton, SWT.RIGHT); multiplicityControlDecoration.setImage(Pics.getImage(PicsConstants.hint)); multiplicityControlDecoration.setDescriptionText(Messages.multiplicity_hint); if (showIsTransient) { isTransientButton = new Button(composite, SWT.CHECK); isTransientButton.setText(Messages.transientLabel); final ControlDecoration controlDecoration = new ControlDecoration(isTransientButton, SWT.RIGHT); controlDecoration.setImage(Pics.getImage(PicsConstants.hint)); controlDecoration.setDescriptionText(Messages.transientHint); } if (showAutoGenerateform) { final IConfigurationElement[] elements = BonitaStudioExtensionRegistryManager.getInstance() .getConfigurationElements( "org.bonitasoft.studio.properties.widget"); //$NON-NLS-1$ IWidgetContribtution generateDataContribution = null; for (final IConfigurationElement elem : elements) { try { if (elem.getAttribute("id").equals(GENERATE_DATA_CONTRIBUTION_ID)) { //$NON-NLS-1$ generateDataContribution = (IWidgetContribtution) elem.createExecutableExtension("class"); //$NON-NLS-1$ } } catch (final CoreException e) { BonitaStudioLog.error(e); } } if (generateDataContribution != null) { generateDataCheckbox = (Button) generateDataContribution.createControl(composite); } } if (showAutoGenerateform && showIsTransient) { if (generateDataCheckbox != null) { generateDataCheckbox.setLayoutData(GridDataFactory.swtDefaults().create()); } isTransientButton.setLayoutData(GridDataFactory.fillDefaults().create()); } else if (showAutoGenerateform && !showIsTransient && generateDataCheckbox != null) { generateDataCheckbox.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).create()); } else if (!showAutoGenerateform && showIsTransient) { isTransientButton.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).create()); } if (showIsTransient) { transientDataWarning = new CLabel(composite, SWT.WRAP); transientDataWarning.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(3, 1).create()); transientDataWarning.setText(Messages.transientDataWarning); transientDataWarning .setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK)); transientDataWarning.setVisible(data.isTransient()); } }