GridData gd = new GridData(SWT.FILL, SWT.TOP, true, false); gd.widthHint = 400; description.setLayoutData(gd); description.addHyperlinkListener(new HyperlinkAdapter() { @Override
/** * Adds an item to the specified section. * * @param toolkit * The form toolkit. * @param sectionTitle * The section title. * @param text * The text which will be shown. * @param image * The image which will be shown. * @param minColumnWidth * the minimum width of the column. */ protected void addItemToSection(FormToolkit toolkit, String sectionTitle, String text, Image image, int minColumnWidth) { if (sections.containsKey(sectionTitle)) { FormText formText = toolkit.createFormText(sections.get(sectionTitle), false); if (image != null) { formText.setText("<form><p><img href=\"img\"/> " + text + "</p></form>", true, false); formText.setImage("img", image); } else { formText.setText("<form><p>" + text + "</p></form>", true, false); } formText.setLayoutData(new GridData(minColumnWidth, SWT.DEFAULT)); } }
private void createFormText(FormToolkit toolkit, Composite parent, String content, int span) { FormText text = toolkit.createFormText(parent, false); text.setText(content, true, false); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = span; gd.widthHint = 400; text.setLayoutData(gd); text.setBackground(parent.getBackground()); text.addHyperlinkListener(this); }
gd.horizontalSpan = 3; gd.widthHint = 400; text.setLayoutData(gd); text.setBackground(null); text.addHyperlinkListener(this);
/** * {@inheritDoc} */ @Override protected Control createContents(Composite parent) { mainComposite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(4, false); layout.marginHeight = 0; layout.marginWidth = 0; mainComposite.setLayout(layout); boolean advancedCreated = false; for (SingleProperty<?> property : properties) { if (!advancedCreated && property.isAdvanced()) { advancedText = new FormText(mainComposite, SWT.WRAP); advancedText.setText("<form><p><b>Advanced properties:</b></p></form>", true, false); advancedText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 4, 1)); advancedCreated = true; } createSinglePropertyContents(property, mainComposite); } Dialog.applyDialogFont(mainComposite); showAdvanced(advancedVisible); mainComposite.layout(); return mainComposite; }
/** * Creates the empty profile hint for the user. */ private void createEmptyInputHint() { FormToolkit toolkit = managedForm.getToolkit(); emptyHintComposite = toolkit.createComposite(tabFolder, SWT.NONE); emptyHintComposite.setLayout(new GridLayout(2, false)); Label infoLabel = toolkit.createLabel(emptyHintComposite, null); infoLabel.setImage(Display.getDefault().getSystemImage(SWT.ICON_INFORMATION)); infoLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false)); FormText formText = toolkit.createFormText(emptyHintComposite, false); formText.setText("<form><p>Seems that there are no sensor assignments in this profile. Use <b>Add</b> action to start defining instrumentation points.</p></form>", true, false); formText.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); tabItem.setControl(emptyHintComposite); tabItem.setText("Getting Started"); tabFolder.setSelection(0); }
/** * Creates Heading for a section with the given heading text. * * @param heading * the heading text */ private void createSectionHeading(String heading) { FormText headingText = toolkit.createFormText(mainComposite, false); GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, NUM_COLUMNS, 1); gridData.verticalIndent = 20; headingText.setLayoutData(gridData); headingText.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE)); headingText.setFont("header", JFaceResources.getBannerFont()); headingText.setText("<form><p><span color=\"header\" font=\"header\">" + heading + "</span></p></form>", true, false); }
private void reviewTask(EditableTask task) { TaskEditor taskEditor = getTaskEditor(task); Composite container = taskEditor.getControl().getParent(); Composite separator = toolkit.createCompositeSeparator(container); GridData data = new GridData(); data.heightHint = 1; data.horizontalAlignment = SWT.FILL; separator.setLayoutData(data); FormText text = toolkit.createFormText(container, false); text.setImage(DescriptionPanel.REVIEW_IMAGE, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.COMPOSITE_TASK_REVIEW)); text.addHyperlinkListener(getEndReviewListener()); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); StringBuilder buf = new StringBuilder(); buf.append("<form>"); //$NON-NLS-1$ addHyperlink(buf, END_REVIEW_TAG + task.getId(), DescriptionPanel.REVIEW_IMAGE, Messages.COMPOSITE_PAGE_END_REVIEW ); buf.append("</form>"); //$NON-NLS-1$ text.setText(buf.toString(), true, false); task.setUnderReview(true); container.layout(true); showEditor(task); }
/** * {@inheritDoc} */ @Override public void createContents(Composite parent) { TableWrapLayout parentLayout = new TableWrapLayout(); parentLayout.topMargin = 5; parentLayout.leftMargin = 5; parentLayout.rightMargin = 2; parentLayout.bottomMargin = 2; parentLayout.numColumns = 2; parentLayout.makeColumnsEqualWidth = true; parent.setLayout(parentLayout); FormToolkit toolkit = managedForm.getToolkit(); // title FormText title = createTitle(parent, toolkit); TableWrapData twd = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP); twd.colspan = 2; title.setLayoutData(twd); super.createContents(parent); // create help to correctly layout twd = new TableWrapData(); twd.grabHorizontal = true; toolkit.createLabel(parent, "", SWT.NONE).setLayoutData(twd); }
formText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
rowText.setLayoutData(rowTextGridData);
totalSql.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); totalDuration.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); percentageOfDuration.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); slowestCount.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); slowestCount.setToolTipText("Amount of slowest SQL Statements that take 80%/20% time of total SQL execution duration");
private FormText createText(Section section, String content, FormToolkit toolkit) { Composite container = toolkit.createComposite(section, SWT.NONE); container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1)); section.setClient(container); FormText text = toolkit.createFormText(container, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); data.maxWidth = 250; text.setLayoutData(data); text.addHyperlinkListener(this); return text; }
/** * Creates a form text. * * @param parent the parent to put the form text on * @param text the form text to be displayed * @return the created form text * * @see FormToolkit#createFormText(org.eclipse.swt.widgets.Composite, boolean) */ private FormText createFormText(Composite parent, String text) { FormToolkit toolkit= new FormToolkit(getShell().getDisplay()); try { FormText formText= toolkit.createFormText(parent, true); formText.setFont(parent.getFont()); try { formText.setText(text, true, false); } catch (IllegalArgumentException e) { formText.setText(e.getMessage(), false, false); JavaPlugin.log(e); } formText.marginHeight= 2; formText.marginWidth= 0; formText.setBackground(null); formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); return formText; } finally { toolkit.dispose(); } }
/** * Creates a form text. * * @param parent the parent to put the form text on * @param text the form text to be displayed * @return the created form text * * @see FormToolkit#createFormText(org.eclipse.swt.widgets.Composite, boolean) */ private FormText createFormText(Composite parent, String text) { FormToolkit toolkit= new FormToolkit(getShell().getDisplay()); try { FormText formText= toolkit.createFormText(parent, true); formText.setFont(parent.getFont()); try { formText.setText(text, true, false); } catch (IllegalArgumentException e) { formText.setText(e.getMessage(), false, false); JavaPlugin.log(e); } formText.marginHeight= 2; formText.marginWidth= 0; formText.setBackground(null); formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); return formText; } finally { toolkit.dispose(); } }
/** * Creates a form text. * * @param parent the parent to put the form text on * @param text the form text to be displayed * @return the created form text * * @see FormToolkit#createFormText(org.eclipse.swt.widgets.Composite, boolean) */ private FormText createFormText(Composite parent, String text) { FormToolkit toolkit= new FormToolkit(getShell().getDisplay()); try { FormText formText= toolkit.createFormText(parent, true); formText.setFont(parent.getFont()); try { formText.setText(text, true, false); } catch (IllegalArgumentException e) { formText.setText(e.getMessage(), false, false); JavaPlugin.log(e); } formText.marginHeight= 2; formText.marginWidth= 0; formText.setBackground(parent.getBackground()); formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); return formText; } finally { toolkit.dispose(); } }
FormText resolveText = toolkit.createFormText(container, true); resolveText.setText(PDEUIMessages.SecondaryBundlesSection_resolve, true, true); resolveText.setLayoutData(gd); resolveText.addHyperlinkListener(new HyperlinkAdapter() { @Override
public Control createControl(Composite parent, final FormToolkit toolkit) { section = toolkit.createSection(parent, Section.SHORT_TITLE_BAR | Section.COMPACT | Section.TWISTIE | Section.EXPANDED | Section.LEFT_TEXT_CLIENT_ALIGNMENT); // section.marginHeight = 10; container = toolkit.createComposite(section); TableWrapLayout layout = new TableWrapLayout(); layout.topMargin = 0; layout.bottomMargin = 0; layout.leftMargin = 0; layout.rightMargin = 0; layout.verticalSpacing = 0; container.setLayout(layout); createFormText(container, toolkit); searchResults.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); searchResults.setColor("summary", parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); //$NON-NLS-1$ section.setClient(container); updateSectionTitle(0); section.addExpansionListener(new IExpansionListener() { public void expansionStateChanging(ExpansionEvent e) { if (needsUpdating) asyncUpdateResults(true, false); } public void expansionStateChanged(ExpansionEvent e) { } }); return section; }
formText.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); formText.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) {
configText.setText(config, true, true); data = new TableWrapData(TableWrapData.FILL_GRAB); configText.setLayoutData(data);