private void staticCreatePartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode( HyperlinkSettings.UNDERLINE_HOVER); // create a page that has only one link. The URL and tooltip will be set // by the standby listener. welcomeLink = createStaticPage(parent); }
/** * Creates a rich text as a part of the form. * * @param parent * the rich text parent * @param trackFocus * if <code>true</code>, the toolkit will monitor focus * transfers to ensure that the hyperlink in focus is visible in * the form. * @return the rich text widget */ public FormText createFormText(Composite parent, boolean trackFocus) { FormText engine = new FormText(parent, SWT.WRAP | orientation); engine.marginWidth = 1; engine.marginHeight = 0; engine.setHyperlinkSettings(getHyperlinkGroup()); adapt(engine, trackFocus, true); engine.setMenu(parent.getMenu()); return engine; }
getForms().getHyperlinkGroup().add(link); getForms().getHyperlinkGroup().add(link);
/** * @param parent */ private void createUIImageHyperlinkPreviewRefDoc(Composite parent) { fImageHyperlinkPreviewRefDoc = new ImageHyperlink(parent, SWT.NONE); fImageHyperlinkPreviewRefDoc.setText(PDEUIMessages.SchemaEditor_previewLink); fImageHyperlinkPreviewRefDoc.setUnderlined(true); fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getForeground()); }
getForms().getHyperlinkGroup().add(link); getForms().getHyperlinkGroup().add(link);
HyperlinkGroup group = forms.getHyperlinkGroup(); group.setBackground(getBackgroundColor());
/** * Create a changes section on the following page. * * @param parent the parent control * @param page the page showing this section * @param configuration the configuration for the synchronize page */ public ChangesSection(Composite parent, AbstractSynchronizePage page, ISynchronizePageConfiguration configuration) { super(parent, SWT.NONE); this.page = page; this.configuration = configuration; GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; setLayout(layout); GridData data = new GridData(GridData.FILL_BOTH); data.grabExcessVerticalSpace = true; setLayoutData(data); forms = new FormToolkit(parent.getDisplay()); forms.setBackground(getListBackgroundColor()); HyperlinkGroup group = forms.getHyperlinkGroup(); group.setBackground(getListBackgroundColor()); changesSectionContainer = new PageBook(this, SWT.NONE); data = new GridData(GridData.FILL_BOTH); data.grabExcessHorizontalSpace = true; data.grabExcessVerticalSpace = true; changesSectionContainer.setLayoutData(data); }
private void createUIImageHyperlinkPreviewRefDoc(Composite parent) { fImageHyperlinkPreviewRefDoc = new ImageHyperlink(parent, SWT.NONE); fImageHyperlinkPreviewRefDoc.setText(PDEUIMessages.SchemaEditor_previewLink); fImageHyperlinkPreviewRefDoc.setUnderlined(true); fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getForeground()); }
/** * Creates a rich text as a part of the form. * * @param parent * the rich text parent * @param trackFocus * if <code>true</code>, the toolkit will monitor focus * transfers to ensure that the hyperlink in focus is visible in * the form. * @return the rich text widget */ public FormText createFormText(Composite parent, boolean trackFocus) { checkDisposed(); FormText engine = new FormText(parent, SWT.WRAP | orientation); engine.marginWidth = 1; engine.marginHeight = 0; engine.setHyperlinkSettings(getHyperlinkGroup()); adapt(engine, trackFocus, true); engine.setMenu(parent.getMenu()); return engine; }
private void handleLinkExitedPreviewRefDoc() { // Update colour fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getForeground()); // Update IDE status line getEditor().getEditorSite().getActionBars().getStatusLineManager().setMessage(null); }
CheatSheetStopWatch.startStopWatch("CheatSheetPage.createPart()"); //$NON-NLS-1$ super.createPart(parent); HyperlinkGroup hyperlinkGroup = toolkit.getHyperlinkGroup(); hyperlinkGroup.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
/** * */ private void handleLinkExitedPreviewRefDoc() { // Update colour fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getForeground()); // Update IDE status line getEditor().getEditorSite().getActionBars().getStatusLineManager().setMessage(null); }
private void handleLinkEnteredPreviewRefDoc(String message) { // Update colour fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getActiveForeground()); // Update IDE status line getEditor().getEditorSite().getActionBars().getStatusLineManager().setMessage(message); }
/** * @param message */ private void handleLinkEnteredPreviewRefDoc(String message) { // Update colour fImageHyperlinkPreviewRefDoc.setForeground(getManagedForm().getToolkit().getHyperlinkGroup().getActiveForeground()); // Update IDE status line getEditor().getEditorSite().getActionBars().getStatusLineManager().setMessage(message); }
public void paintControl(PaintEvent e) { validateLastItem(); if (lastItem == null) return; Rectangle bounds = lastItem.getBounds(); boolean selected = false; TreeItem[] items = lastItem.getParent().getSelection(); for (int i = 0; i < items.length; i++) { if (items[i].equals(lastItem)) { selected = true; break; } } if (selected) e.gc.setForeground(e.display.getSystemColor( SWT.COLOR_LIST_SELECTION_TEXT)); else e.gc.setForeground(toolkit.getHyperlinkGroup() .getActiveForeground()); FontMetrics fm = e.gc.getFontMetrics(); int height = fm.getHeight(); int lineY = bounds.y + height; e.gc.drawLine(bounds.x, lineY, bounds.x + bounds.width - 1, lineY); } });
private void dynamicCreatePartControl(Composite container) { // Create single toolkit instance, which is disposed of on dispose of // intro part. also define background of all presentation. toolkit = new FormToolkit(container.getDisplay()); // Define presentation title color Color bg = sharedStyleManager.getColor(toolkit, "bg"); //$NON-NLS-1$ if (bg != null) { toolkit.setBackground(bg); } toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode( HyperlinkSettings.UNDERLINE_HOVER); // Define presentation title color and image. Form mainForm = toolkit.createForm(container); Color fg = sharedStyleManager.getColor(toolkit, "title.fg"); //$NON-NLS-1$ if (fg != null) mainForm.setForeground(fg); Image bgImage = sharedStyleManager.getImage("title.image", null, null); //$NON-NLS-1$ if (bgImage != null) { mainForm.setBackgroundImage(bgImage); String repeat = sharedStyleManager .getProperty("title.image.repeat"); //$NON-NLS-1$ if (repeat != null && repeat.equalsIgnoreCase("true")) //$NON-NLS-1$ mainForm.setBackgroundImageTiled(true); } mainPageBook = createMainPageBook(toolkit, mainForm); // Add this presentation as a listener to model. getModel().addPropertyListener(this); addToolBarActions(); }
ftext.marginWidth = 2; ftext.marginHeight = 2; ftext.setHyperlinkSettings(toolkit.getHyperlinkGroup()); formText.addDisposeListener(e -> { if (toolkit != null) {
protected void handleSelectionChanged(IStructuredSelection sel) { Object obj = sel.getFirstElement(); if (lastItem != null && !lastItem.isDisposed()) { Object lastObj = lastItem.getData(); if (lastObj==obj) lastItem.setForeground(getControl().getDisplay() .getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT)); else lastItem.setForeground(parent.getForm().getToolkit().getHyperlinkGroup() .getActiveForeground()); repaintItem(lastItem); } if (obj instanceof IHelpResource) { IHelpResource res = (IHelpResource) obj; updateStatus(res, false); } else updateStatus(null, false); }
public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode( HyperlinkGroup.UNDERLINE_HOVER); // toolkit.setBackground(toolkit.getColors().createNoContentBackground()); toolkit.getColors().initializeSectionToolBarColors(); reusableHelpPart.createControl(parent, toolkit); reusableHelpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); reusableHelpPart.showPage(getFirstPage()); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); if (window == null) return; IWorkbenchPage page = window.getActivePage(); if (page == null) return; IWorkbenchPartReference aref = page.getActivePartReference(); if (aref != null) handlePartActivation(aref); }
/** * Creates a new expandable static section for a given form * * @param toolkit Toolkit for the new section * @param parent Parent of the new section * @param text Title for the new section * @param description New section description * @param form the given form * @return the new section */ public static Section createStaticSection(FormToolkit toolkit, Composite parent, String text ,String description, final ScrolledForm form) { final Section section = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR | Section.TWISTIE); section.setActiveToggleColor(toolkit.getHyperlinkGroup().getActiveForeground()); section.setToggleColor(toolkit.getColors().getColor(IFormColors.SEPARATOR)); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(text); section.setDescription(description); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); section.setExpanded(true); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(false); form.setFocus(); } }); return section; }