/** * Creates a text as a part of the form. * * @param parent * the text parent * @param value * the text initial value * @return the text widget */ public Text createText(Composite parent, String value) { return createText(parent, value, SWT.SINGLE); }
/** * Creates a text as a part of the form. * * @param parent * the text parent * @param value * the text initial value * @return the text widget */ public Text createText(Composite parent, String value) { return createText(parent, value, SWT.SINGLE); }
public static Text createText(Composite parent, FormToolkit factory, int span) { Text text = factory.createText(parent, ""); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
public static Text createText(Composite parent, FormToolkit factory, int span) { Text text = factory.createText(parent, ""); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
/** * {@inheritDoc} */ @Override public void createPartControl(Composite parent, FormToolkit toolkit) { stackTraceText = toolkit.createText(parent, "", SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); stackTraceText.setEditable(false); stackTraceText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); }
public static Text createText(Composite parent, String label, FormToolkit factory, int span) { factory.createLabel(parent, label); Text text = factory.createText(parent, ""); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
public static Text createText(Composite parent, String label, FormToolkit factory, int span) { factory.createLabel(parent, label); Text text = factory.createText(parent, ""); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
public static Text createText(Composite parent, String label, FormToolkit factory, int span, int style) { Label l = factory.createLabel(parent, label); if ((style & SWT.MULTI) != 0) { GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); l.setLayoutData(gd); } Text text = factory.createText(parent, "", style); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
public static Text createText(Composite parent, String label, FormToolkit factory, int span, int style) { Label l = factory.createLabel(parent, label); if ((style & SWT.MULTI) != 0) { GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); l.setLayoutData(gd); } Text text = factory.createText(parent, "", style); //$NON-NLS-1$ int hfill = span == 1 ? GridData.FILL_HORIZONTAL : GridData.HORIZONTAL_ALIGN_FILL; GridData gd = new GridData(hfill | GridData.VERTICAL_ALIGN_CENTER); gd.horizontalSpan = span; text.setLayoutData(gd); return text; }
/** * New text with tip. * * @param parent the parent * @param text the text * @param style the style * @param tip the tip * @return the text */ protected Text newTextWithTip(Composite parent, String text, int style, String tip) { Text t = toolkit.createText(parent, text, style); t.setToolTipText(tip); if ((style & SWT.V_SCROLL) == SWT.V_SCROLL) { t.setLayoutData(new GridData(GridData.FILL_BOTH)); } else { t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } addListenerForPastableWidget(t); return t; }
@Override public void createPartControl(Composite parent, FormToolkit toolkit) { contentComposite = toolkit.createComposite(parent); contentComposite.setLayout(new GridLayout()); // Util.highlight(contentComposite, SWT.COLOR_YELLOW); String text = Messages.EmptyStandbyContentPart_text; Label label = toolkit.createLabel(contentComposite, text, SWT.WRAP); label.setFont(PageStyleManager.getBannerFont()); GridData gd = new GridData(GridData.FILL_HORIZONTAL); label.setLayoutData(gd); contentText = toolkit.createText(contentComposite, " ", SWT.MULTI //$NON-NLS-1$ | SWT.WRAP); GridData textGd = new GridData(GridData.FILL_BOTH); contentText.setLayoutData(textGd); }
private void createBasicInfo(Composite parent) { Composite comp = fCCP.createComposite(parent, GridData.FILL_HORIZONTAL, 2, false, 0); fToolkit.createLabel(comp, PDEUIMessages.CommandDetails_id); fComIDT = fToolkit.createText(comp, PDEUIMessages.CommandDetails_noComSelected, SWT.BORDER); fComIDT.setEditable(false); fComIDT.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); }
@Override protected Text doCreateFilterText(Composite parent) { // Overridden so the text gets create using the toolkit if we have one Text parentText = super.doCreateFilterText(parent); if (fToolkit != null) { int style = parentText.getStyle(); parentText.dispose(); return fToolkit.createText(parent, null, style); } return parentText; }
protected Text doCreateFilterText(Composite actParent) { // Overridden so the text gets create using the toolkit if we have one Text parentText = super.doCreateFilterText(actParent); if (fToolkit != null) { int style = parentText.getStyle(); parentText.dispose(); return fToolkit.createText(actParent, null, style); } return parentText; }
@Override public void create(Composite parent, boolean enabled) { Label label = fBlock.getToolkit().createLabel(parent, getLabel()); label.setEnabled(enabled); TableWrapData td = new TableWrapData(); td.valign = TableWrapData.MIDDLE; label.setLayoutData(td); text = fBlock.getToolkit().createText(parent, ""); //$NON-NLS-1$ td = new TableWrapData(TableWrapData.FILL_GRAB); //gd.widthHint = 100; text.setLayoutData(td); text.setEnabled(enabled); createCommentDecorator(label, enabled); }
@Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); createLabel(parent, toolkit); text = toolkit.createText(parent, "", SWT.SINGLE); //$NON-NLS-1$ text.setLayoutData(createGridData(span)); text.addModifyListener(e -> { if (!blockNotification) markDirty(); PDETextHover.updateHover(fIC, getHoverContent(text)); }); text.setEditable(part.isEditable()); PDETextHover.addHoverListenerToControl(fIC, text, this); // Create a focus listener to update selectable actions createUITextFocusListener(); }
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType ) { this.toolkit.createLabel ( parent, label + ":" ); final Text text = this.toolkit.createText ( parent, "" ); text.setMessage ( textMessage ); text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) ); text.setToolTipText ( textMessage ); final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value ); final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE ); link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) ); link.addHyperlinkListener ( new HyperlinkAdapter () { @Override public void linkActivated ( final HyperlinkEvent e ) { EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () ); } } ); }
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType ) { this.toolkit.createLabel ( parent, label + ":" ); final Text text = this.toolkit.createText ( parent, "" ); text.setMessage ( textMessage ); text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) ); text.setToolTipText ( textMessage ); final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType ); this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value ); final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE ); link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) ); link.addHyperlinkListener ( new HyperlinkAdapter () { @Override public void linkActivated ( final HyperlinkEvent e ) { EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () ); } } ); }
public void createContents(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); fSection = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); fSection.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; fSection.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); GridData gd = new GridData(GridData.FILL_HORIZONTAL); fSection.setLayoutData(gd); Composite client = toolkit.createComposite(fSection); client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 1)); fDtdText = toolkit.createText(client, "", SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);//$NON-NLS-1$ gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 60; fDtdText.setLayoutData(gd); fDtdText.setEditable(false); // remove pop-up menu fDtdText.setMenu(new Menu(client)); toolkit.paintBordersFor(client); fSection.setClient(client); fSection.setText(PDEUIMessages.SchemaDtdDetailsSection_title); }
private void createPreviewLabelComp(Composite parent) { Composite preLabelComp = fCCP.createComposite(parent, GridData.FILL_HORIZONTAL, 3, false, 0); fToolkit.createLabel(preLabelComp, PDEUIMessages.CommandDetails_preview, SWT.NONE).setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fSurroundCopyText = fToolkit.createButton(preLabelComp, PDEUIMessages.CommandDetails_includeMarkup, SWT.CHECK); fSurroundCopyText.setToolTipText(PDEUIMessages.CommandDetails_markupTooltip); fSurroundCopyText.addSelectionListener(widgetSelectedAdapter(e -> updatePreviewText())); fFilterCombo = new Combo(preLabelComp, SWT.READ_ONLY | SWT.DROP_DOWN); CommandCopyFilter[] filters = CommandCopyFilter.getFilters(); for (CommandCopyFilter filter : filters) fFilterCombo.add(filter.getLabelText()); fFilterCombo.select(CommandCopyFilter.indexOf(CommandCopyFilter.NONE)); fFilterCombo.addSelectionListener(widgetSelectedAdapter(e -> updatePreviewText())); fToolkit.adapt(fFilterCombo, true, true); fComPrev = fToolkit.createText(parent, "", SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); //$NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 60; fComPrev.setLayoutData(gd); fComPrev.setEditable(false); }