/** * Creates the testing area. * * @param client the client * @param toolkit the toolkit * @param actionBars the action bars */ private void createTestingArea( final Composite client, final FormToolkit toolkit, final IActionBars actionBars) { ImageHyperlink imageHyperlink = toolkit.createImageHyperlink(client, SWT.None); imageHyperlink.setText("Launch a local component"); imageHyperlink.setHref(TestingSection.TESTING_HREF_LOCAL_LAUNCH); imageHyperlink.addHyperlinkListener(this.getPage()); imageHyperlink.setImage(ComponentImages.getImage(ComponentImages.RUN_EXEC)); // imageHyperlink = toolkit.createImageHyperlink(client, SWT.None); // imageHyperlink.setText("Launch a remote component"); // imageHyperlink.setHref(TestingSection.TESTING_HREF); // imageHyperlink.addHyperlinkListener(this.getPage()); imageHyperlink = toolkit.createImageHyperlink(client, SWT.None); imageHyperlink.setText("Launch a local component in debug mode"); imageHyperlink.setHref(TestingSection.TESTING_HREF_LOCAL_DEBUG); imageHyperlink.addHyperlinkListener(this.getPage()); imageHyperlink.setEnabled(getPage().getEditor().getMainResource().getURI().isPlatform()); imageHyperlink.setImage(ComponentImages.getImage(ComponentImages.DEBUG_EXEC)); // imageHyperlink = toolkit.createImageHyperlink(client, SWT.None); // imageHyperlink.setText("Launch a remote component in debug mode"); // imageHyperlink.setHref(TestingSection.TESTING_HREF); // imageHyperlink.addHyperlinkListener(this.getPage()); }
@Override protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayoutFactory.fillDefaults().applyTo(container); if (studyParameters.getCustomizingPlugin() != null) { Label label = new Label(parent, SWT.NULL); label.setText(studyParameters.getCustomizedByMessage()); label.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); if (studyParameters.getMoreInformationUrl() != null) { ImageHyperlink link = new ImageHyperlink(parent, SWT.NONE); link.setText(Messages.UsageDataPreferencePage_Learn_More); link.setForeground(CommonColors.HYPERLINK_WIDGET); link.addHyperlinkListener( new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { openMoreInformaionInBrowser(); } }); } } createLogFileSection(container); createUsageSection(container); updateEnablement(); Dialog.applyDialogFont(container); return container; }
private void addOptions() { Map<String, Composite> sections = new HashMap<String, Composite>(); for (IOption option : action.getConfiguration().getOptions()) { Composite parent = body; if (option instanceof Option) { if (((Option) option).isFixed()) continue; String sectionName = ((Option) option).getSection(); if (sectionName != null) { parent = sections.get(sectionName); if (parent == null) { Section section = toolkit.createSection(body, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); section.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); section.setExpanded(false); section.addExpansionListener( new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(true); } }); section.setText(sectionName); // section.setDescription("This is the description that goes below the title"); Composite sectionClient = toolkit.createComposite(section); sectionClient.setLayout(new GridLayout()); section.setClient(sectionClient); sections.put(sectionName, sectionClient); parent = sectionClient; } } } addOption(parent, option); } runLink = toolkit.createImageHyperlink(body, SWT.NONE); // runLink.setFont(JFaceResources.getHeaderFont()); runLink.setImage(runImage); runLink.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true)); runLink.setText("Run"); updateRunButton(); runLink.addHyperlinkListener( new HyperlinkAdapter() { @Override public void linkActivated(HyperlinkEvent e) { safeRun(); } }); }
@Override protected void setWidgetText(ImageHyperlink widget, String text) { widget.setText(text); }