Java Code Examples for org.eclipse.swt.widgets.Label#setImage()
The following examples show how to use
org.eclipse.swt.widgets.Label#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: WaitDialog.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
@Override protected Control createContents(Composite parent) { centerDialogOnScreen(getShell()); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); composite.setLayoutData(new GridData(CENTER, CENTER, true, true)); composite.setRedraw(true); Label imgLabel = new Label(composite, SWT.NONE); imgLabel.setImage(iconImage); textLabel = new Label(composite, SWT.NONE); textLabel.setLayoutData(new GridData(CENTER, CENTER, true, true)); textLabel.setFont(GUIHelper.getFont(new FontData("Arial", 9, SWT.BOLD))); textLabel.setRedraw(true); textLabel.setText(msg); return composite; }
Example 2
Source File: XViewerCustomizeDialog.java From nebula with Eclipse Public License 2.0 | 6 votes |
private void createFilterTextBlock(final Composite composite) { // Filter text block final Composite composite_7 = new Composite(composite, SWT.NONE); composite_7.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1)); final GridLayout gridLayout_13 = new GridLayout(); gridLayout_13.numColumns = 5; composite_7.setLayout(gridLayout_13); final Label filterLabel = new Label(composite_7, SWT.NONE); filterLabel.setText(XViewerText.get("XViewerCustomizeDialog.filter.text")); //$NON-NLS-1$ filterText = new Text(composite_7, SWT.BORDER); filterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); Label filterLabel2 = new Label(composite_7, SWT.NONE); filterLabel2.setText(XViewerText.get("XViewerCustomizeDialog.filter.expression")); //$NON-NLS-1$ filterRegExCheckBox = new Button(composite_7, SWT.CHECK); filterRegExCheckBox.setLayoutData(new GridData(SWT.RIGHT, SWT.NONE, false, false)); final Label clearFilterLabel = new Label(composite_7, SWT.PUSH); clearFilterLabel.setImage(XViewerLib.getImage("clear.gif")); //$NON-NLS-1$ clearFilterLabel.addListener(SWT.MouseUp, e -> filterText.setText("")); //$NON-NLS-1$ }
Example 3
Source File: ArtifactEditor.java From depan with Apache License 2.0 | 6 votes |
/** * Creates a new {@link ArtifactEditor}. * * @param parent parent Container. * @param style SWT style for the container. * @param swtTextStyle SWT style for textboxes. Useful to set them * SWT.READ_ONLY for instance. */ public ArtifactEditor( Composite parent, Integer style, Integer swtTextStyle) { super(parent, style, swtTextStyle); // widgets icon = new Label(this, SWT.NONE); Label labelName = new Label(this, SWT.NONE); path = new Text(this, swtTextStyle); // layout Layout layout = new GridLayout(3, false); this.setLayout(layout); GridData iconGridData = new GridData(SWT.FILL, SWT.FILL, false, false); iconGridData.minimumHeight = 16; iconGridData.minimumWidth = 16; icon.setLayoutData(iconGridData); labelName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); path.setLayoutData( new GridData(SWT.FILL, SWT.FILL, true, false)); // content icon.setImage(MavenActivator.IMAGE_MAVEN); labelName.setText("Path"); }
Example 4
Source File: InitFinishMessageDialog.java From tesb-studio-se with Apache License 2.0 | 5 votes |
@Override protected Control createMessageArea(Composite composite) { // create image Image image = getImage(); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel); } Link link = new Link(composite, SWT.WRAP); link.setText("Local runtime serview has been started, totally installed bundles: <a href=\"#\">" + bundlesName.length + "</a>."); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ElementListSelectionDialog report = new ElementListSelectionDialog(getShell(), new LabelProvider()); report.setTitle("Installed bundles:"); report.setMessage("Search bundle (? = any character, * = any string):"); report.setElements(bundlesName); report.open(); } }); return composite; }
Example 5
Source File: MessageWizardPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void createControl(Composite parent) { initializeDialogUnits(parent); Composite result= new Composite(parent, SWT.NONE); setControl(result); GridLayout layout= new GridLayout(); layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN) * 3 / 2; layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING) * 2; layout.numColumns= 2; result.setLayout(layout); Image image= getMessageImage(); if (image != null) { Label label= new Label(result, SWT.NULL); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } String message= getMessageString(); if (message != null) { Label messageLabel= new Label(result, SWT.WRAP); messageLabel.setText(message); GridData data= new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING); data.widthHint= convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); messageLabel.setLayoutData(data); messageLabel.setFont(result.getFont()); } Dialog.applyDialogFont(result); }
Example 6
Source File: PageSettingDialog.java From ermasterr with Apache License 2.0 | 5 votes |
private void initDirectionGroup(final Composite parent) { final GridData gridData = new GridData(); gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = GridData.FILL; final Group directionGroup = new Group(parent, SWT.NONE); directionGroup.setLayoutData(gridData); directionGroup.setText(ResourceString.getResourceString("label.page.direction")); final GridLayout directionGroupLayout = new GridLayout(); directionGroupLayout.marginWidth = 20; directionGroupLayout.horizontalSpacing = 20; directionGroupLayout.numColumns = 4; directionGroup.setLayout(directionGroupLayout); final Label vImage = new Label(directionGroup, SWT.NONE); vImage.setImage(ERDiagramActivator.getImage(ImageKey.PAGE_SETTING_V)); vButton = new Button(directionGroup, SWT.RADIO); vButton.setText(ResourceString.getResourceString("label.page.direction.v")); final Label hImage = new Label(directionGroup, SWT.NONE); hImage.setImage(ERDiagramActivator.getImage(ImageKey.PAGE_SETTING_H)); hButton = new Button(directionGroup, SWT.RADIO); hButton.setText(ResourceString.getResourceString("label.page.direction.h")); }
Example 7
Source File: ResultMessage.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
/** * Create the shell. * @param display */ public ResultMessage(Display display, String imagePath) { super(display, SWT.NONE); GridLayout gridLayout = new GridLayout(1, false); gridLayout.verticalSpacing = 0; gridLayout.marginWidth = 0; gridLayout.horizontalSpacing = 0; gridLayout.marginHeight = 0; setLayout(gridLayout); Label lblNewLabel = new Label(this, SWT.NONE); lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); lblNewLabel.setImage(Activator.getImage(imagePath)); createContents(); }
Example 8
Source File: UtilsUI.java From EasyShell with Eclipse Public License 2.0 | 5 votes |
static public Label createLabel(Composite parent, String imageId, String text, String tooltip) { Label label = new Label(parent, SWT.LEFT); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); if (text != null) { label.setText(text); label.setToolTipText(tooltip); } label.setImage(Activator.getImage(imageId)); return label; }
Example 9
Source File: CommonStepDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
private void buildHeader() { buildPreHeader(); // Step icon final Label wicon = new Label( shell, SWT.RIGHT ); wicon.setImage( getImage() ); wicon.setLayoutData( new FormDataBuilder().top( 0, -BaseDialog.LABEL_SPACING ).right( 100, 0 ).result() ); props.setLook( wicon ); // Step name label wlStepname = new Label( shell, SWT.RIGHT ); wlStepname.setText( BaseMessages.getString( PKG, "CommonStepDialog.Stepname.Label" ) ); //$NON-NLS-1$ props.setLook( wlStepname ); fdlStepname = new FormDataBuilder().left( 0, 0 ).top( 0, -BaseDialog.LABEL_SPACING ).result(); wlStepname.setLayoutData( fdlStepname ); // Step name field wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wStepname.setText( stepname ); props.setLook( wStepname ); wStepname.addModifyListener( lsMod ); wStepname.addSelectionListener( lsDef ); fdStepname = new FormDataBuilder().width( BaseDialog.MEDIUM_FIELD ).left( 0, 0 ).top( wlStepname, BaseDialog.LABEL_SPACING ).result(); wStepname.setLayoutData( fdStepname ); // horizontal separator between step name and tabs headerSpacer = new Label( shell, SWT.HORIZONTAL | SWT.SEPARATOR ); props.setLook( headerSpacer ); headerSpacer.setLayoutData( new FormDataBuilder().left().right( 100, 0 ).top( wStepname, BaseDialog.MARGIN_SIZE ).width( SHELL_WIDTH - 2 * ( BaseDialog.MARGIN_SIZE ) ).result() ); buildPostHeader(); }
Example 10
Source File: ChoiceWidget.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Build the green arrow */ private void buildGreenArrow() { final Image greenArrow = SWTGraphicUtil.createImageFromFile("images/arrowGreenRight.png"); image = new Label(this, SWT.NONE); image.setImage(greenArrow); image.setLayoutData(new GridData(GridData.CENTER, GridData.BEGINNING, false, false, 1, 2)); SWTGraphicUtil.addDisposer(this, greenArrow); }
Example 11
Source File: ItemView.java From http4e with Apache License 2.0 | 5 votes |
private void initAuthProxyBtns( Composite parent){ lblAuth = new Label(parent, SWT.NONE); lblAuth.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_UI, CoreImages.AUTH_TAB)); lblAuth.setToolTipText("Using BASIC, DIGEST Authentication"); lblProxy = new Label(parent, SWT.NONE); lblProxy.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_UI, CoreImages.PROXY_TAB)); lblProxy.setToolTipText("Using Proxy Connection"); }
Example 12
Source File: LabelImageLoader.java From google-cloud-eclipse with Apache License 2.0 | 5 votes |
/** * Loads an image to a {@link Label}. The image will be fetched from {@code imageUrl} * asynchronously if not previously cached. * * Must be called in the UI context. */ @VisibleForTesting public void loadImage(String imageUrl, Label label) throws MalformedURLException { Preconditions.checkNotNull(imageUrl); ImageData imageData = cache.get(imageUrl); if (imageData != null) { Image image = new Image(label.getDisplay(), imageData); label.addDisposeListener(new ImageDisposer(image)); label.setImage(image); } else { loadJob = new LabelImageLoadJob(new URL(imageUrl), label); loadJob.schedule(); } }
Example 13
Source File: BonitaPreferenceDialog.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
protected void createTitleBar(final Composite parent, final String titleLabel, final Image image) { final Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); if (parent.getLayout() instanceof GridLayout) { composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); } final Label imageLabel = new Label(composite, SWT.NONE); imageLabel.setImage(image); final Label title = new Label(composite, SWT.NONE); title.setText(titleLabel); title.setFont(BonitaStudioFontRegistry.getPreferenceTitleFont()); }
Example 14
Source File: PluginHelpDialog.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
@Override protected Control createDialogArea(Composite parent) { Composite tparent = (Composite) super.createDialogArea(parent); tparent.setLayout(new GridLayout()); tparent.setLayoutData(new GridData(GridData.FILL_BOTH)); Label logo = new Label(tparent, SWT.BORDER); logo.setImage(Activator.getImageDescriptor(PluginConstants.HELP_SPLASH).createImage()); return tparent; }
Example 15
Source File: DetailsDialog.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
final protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite)super.createDialogArea(parent); // create image if (image != null) { // create a composite to split the dialog area in two Composite top = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = 0; layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.numColumns = 2; top.setLayout(layout); top.setLayoutData(new GridData(GridData.FILL_BOTH)); top.setFont(parent.getFont()); // add the image to the left of the composite Label label = new Label(top, 0); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER)); // add a composite to the right to contain the custom components Composite right = new Composite(top, SWT.NONE); layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); right.setLayout(layout); right.setLayoutData(new GridData(GridData.FILL_BOTH)); right.setFont(parent.getFont()); createMainDialogArea(right); } else { createMainDialogArea(composite); } errorMessageLabel = new Label(composite, SWT.NONE); errorMessageLabel.setLayoutData(new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); errorMessageLabel.setFont(parent.getFont()); errorMessageLabel.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_RED)); return composite; }
Example 16
Source File: CheckBoxToolTip.java From pentaho-kettle with Apache License 2.0 | 4 votes |
protected Composite createToolTipContentArea( Event event, Composite parent ) { Composite composite = new Composite( parent, SWT.NONE ); FormLayout compLayout = new FormLayout(); compLayout.marginHeight = 5; compLayout.marginWidth = 5; composite.setLayout( compLayout ); composite.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); Label imageLabel = new Label( composite, SWT.NONE ); imageLabel.setImage( image ); imageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); FormData fdImageLabel = new FormData(); fdImageLabel.left = new FormAttachment( 0, 0 ); fdImageLabel.top = new FormAttachment( 0, 0 ); imageLabel.setLayoutData( fdImageLabel ); Label titleLabel = new Label( composite, SWT.LEFT ); titleLabel.setText( title ); titleLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); titleLabel.setFont( GUIResource.getInstance().getFontBold() ); FormData fdTitleLabel = new FormData(); fdTitleLabel.left = new FormAttachment( imageLabel, 20 ); fdTitleLabel.top = new FormAttachment( 0, 0 ); titleLabel.setLayoutData( fdTitleLabel ); Label line = new Label( composite, SWT.SEPARATOR | SWT.HORIZONTAL ); line.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); FormData fdLine = new FormData(); fdLine.left = new FormAttachment( imageLabel, 5 ); fdLine.right = new FormAttachment( 100, -5 ); fdLine.top = new FormAttachment( titleLabel, 5 ); line.setLayoutData( fdLine ); // Text messageLabel = new Text(composite, SWT.LEFT | ( showingScrollBars ? SWT.H_SCROLL | SWT.V_SCROLL : SWT.NONE ) // ); /* * Text messageLabel = new Text(composite, SWT.SINGLE | SWT.LEFT); messageLabel.setText(message); * messageLabel.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); FormData fdMessageLabel = new * FormData(); fdMessageLabel.left = new FormAttachment(imageLabel, 20); fdMessageLabel.top = new * FormAttachment(line, 5); if (showingScrollBars) { fdMessageLabel.right = new FormAttachment(imageLabel, 500); * fdMessageLabel.bottom= new FormAttachment(line, 400); } messageLabel.setLayoutData(fdMessageLabel); */ Label messageLabel = new Label( composite, SWT.LEFT ); messageLabel.setText( message ); messageLabel.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); FormData fdMessageLabel = new FormData(); fdMessageLabel.left = new FormAttachment( imageLabel, 20 ); fdMessageLabel.top = new FormAttachment( line, 5 ); messageLabel.setLayoutData( fdMessageLabel ); final Button disable = new Button( composite, SWT.CHECK ); disable.setText( checkBoxMessage ); disable.setBackground( display.getSystemColor( SWT.COLOR_INFO_BACKGROUND ) ); disable.setSelection( false ); FormData fdDisable = new FormData(); fdDisable.left = new FormAttachment( 0, 0 ); fdDisable.top = new FormAttachment( messageLabel, 20 ); fdDisable.bottom = new FormAttachment( 100, 0 ); disable.setLayoutData( fdDisable ); disable.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { for ( CheckBoxToolTipListener listener : listeners ) { listener.checkBoxSelected( false ); } hide(); } } ); disable.addPaintListener( new PaintListener() { public void paintControl( PaintEvent arg0 ) { checkBoxBounds = disable.getBounds(); } } ); composite.layout(); checkBoxBounds = disable.getBounds(); return composite; }
Example 17
Source File: DBConnectSelectionConnectionWizardPage.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
private void createEntityArea(Group grpEntity){ String driver = ""; String user = ""; String typ = ""; String connection = ""; Composite typArea = new Composite(grpEntity, SWT.NONE); typArea.setLayout(new GridLayout(2, false)); Label lTyp = new Label(typArea, SWT.NONE); lTyp.setImage(Images.IMG_TABLE.getImage()); lblTyp = new Label(typArea, SWT.NONE); Composite driverArea = new Composite(grpEntity, SWT.NONE); driverArea.setLayout(new GridLayout(2, false)); Label lDriver = new Label(driverArea, SWT.NONE); lDriver.setImage(Images.IMG_GEAR.getImage()); lblDriver = new Label(driverArea, SWT.NONE); Composite userArea = new Composite(grpEntity, SWT.NONE); userArea.setLayout(new GridLayout(2, false)); Label lUser = new Label(userArea, SWT.NONE); lUser.setImage(Images.IMG_USER_SILHOUETTE.getImage()); lblUser = new Label(userArea, SWT.NONE); Composite connArea = new Composite(grpEntity, SWT.NONE); connArea.setLayout(new GridLayout(2, false)); Label lConnection = new Label(connArea, SWT.NONE); lConnection.setImage(Images.IMG_NODE.getImage()); lblConnection = new Label(connArea, SWT.NONE); Hashtable<Object, Object> conn = readRunningEntityInfos(); if (conn != null) { driver = PersistentObject.checkNull(conn.get(Preferences.CFG_FOLDED_CONNECTION_DRIVER)); connection = PersistentObject.checkNull(conn .get(Preferences.CFG_FOLDED_CONNECTION_CONNECTSTRING)); user = PersistentObject.checkNull(conn.get(Preferences.CFG_FOLDED_CONNECTION_USER)); typ = PersistentObject.checkNull(conn.get(Preferences.CFG_FOLDED_CONNECTION_TYPE)); } lblTyp.setText(typ); lblDriver.setText(driver); lblUser.setText(user); lblConnection.setText(connection); }
Example 18
Source File: AboutDialog.java From devstudio-tooling-ei with Apache License 2.0 | 4 votes |
protected Control createDialogArea(Composite parent) { Image logoImage = ResourceManager.getPluginImage("org.wso2.developerstudio.eclipse.platform.ui", "icons/ei-tooling-logo.png"); logoWidth = logoImage.getImageData().width; logoHeight = logoImage.getImageData().height; parent.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); Composite dialogArea = (Composite) super.createDialogArea(parent); dialogArea.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); dialogArea.setSize(new Point(logoWidth, logoHeight * 4 - 60)); Composite composite = new Composite(dialogArea, SWT.BORDER); composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); composite.setLayout(new GridLayout(1, false)); composite.setSize(new Point(logoWidth + 45, logoHeight * 4 - 60)); GridData gd_composite = new GridData(SWT.CENTER, SWT.TOP, true, true, 1, 1); gd_composite.widthHint = logoWidth + 45; gd_composite.heightHint = logoHeight * 4 - 60; composite.setLayoutData(gd_composite); Label lblDevsLogo = new Label(composite, SWT.NONE); lblDevsLogo.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); lblDevsLogo.setImage(logoImage); GridData gdDevsLogo = new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1); gdDevsLogo.widthHint = logoWidth; gdDevsLogo.heightHint = logoHeight; lblDevsLogo.setLayoutData(gdDevsLogo); Label lblVersion = new Label(composite, SWT.NONE); GridData versionGrid = new GridData(); versionGrid.horizontalIndent = 25; lblVersion.setLayoutData(versionGrid); lblVersion.setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BORDER)); lblVersion.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); lblVersion.setText(VERSION); Label lblLicense = new Label(composite, SWT.NONE); GridData licenseGrid = new GridData(); licenseGrid.horizontalIndent = 25; lblLicense.setLayoutData(licenseGrid); lblLicense.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); lblLicense.setText(LICENSED); Link linkDevStudioUrl = new Link(composite, SWT.NONE); GridData urlGrid = new GridData(); urlGrid.horizontalIndent = 25; linkDevStudioUrl.setLayoutData(urlGrid); linkDevStudioUrl.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); linkDevStudioUrl.setText("Visit :<a>" + URL + "</a>"); linkDevStudioUrl.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { org.eclipse.swt.program.Program.launch(URL); } }); addProductIcons(composite); return dialogArea; }
Example 19
Source File: TextVar.java From hop with Apache License 2.0 | 4 votes |
protected void initialize( IVariables variables, Composite composite, int flags, String toolTipText, IGetCaretPosition getCaretPositionInterface, IInsertText insertTextInterface, SelectionListener selectionListener ) { this.toolTipText = toolTipText; this.getCaretPositionInterface = getCaretPositionInterface; this.insertTextInterface = insertTextInterface; this.variables = variables; PropsUi.getInstance().setLook( this ); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = 0; formLayout.marginHeight = 0; formLayout.marginTop = 0; formLayout.marginBottom = 0; this.setLayout( formLayout ); // Add the variable $ image on the top right of the control // Label wlImage = new Label( this, SWT.NONE ); wlImage.setImage( GuiResource.getInstance().getImageVariable() ); wlImage.setToolTipText( BaseMessages.getString( PKG, "TextVar.tooltip.InsertVariable" ) ); FormData fdlImage = new FormData(); fdlImage.top = new FormAttachment( 0, 0 ); fdlImage.right = new FormAttachment( 100, 0 ); wlImage.setLayoutData( fdlImage ); // add a text field on it... wText = new Text( this, flags ); FormData fdText = new FormData(); fdText.top = new FormAttachment( 0, 0 ); fdText.left = new FormAttachment( 0, 0 ); fdText.right = new FormAttachment( wlImage, 0 ); fdText.bottom = new FormAttachment( 100, 0 ); wText.setLayoutData( fdText ); modifyListenerTooltipText = getModifyListenerTooltipText( wText ); wText.addModifyListener( modifyListenerTooltipText ); controlSpaceKeyAdapter = new ControlSpaceKeyAdapter( variables, wText, getCaretPositionInterface, insertTextInterface ); wText.addKeyListener( controlSpaceKeyAdapter ); }
Example 20
Source File: ImportFileWizardPage.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
protected void updatePanel(final ImporterFactory importerFactory, final Label descriptionImage, final Label descriptionLabel) { descriptionLabel.setText(importerFactory.getDescription()); descriptionImage.setImage(importerFactory.getImageDescription()); descriptionImage.getParent().getParent().layout(true, true); descriptionLabel.redraw(); }