private void createHeader(Composite contents) { final Shell shell = contents.getShell(); String text = PreferencesMessages.JavaEditorPreferencePage_link; Link link = new Link(contents, SWT.NONE); link.setText(text); link.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) // $NON-NLS-1$ PreferencesUtil.createPreferenceDialogOn(shell, e.text, null, null); else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) // $NON-NLS-1$ PreferencesUtil.createPreferenceDialogOn( shell, e.text, null, "selectFont:org.eclipse.jdt.ui.editors.textfont"); //$NON-NLS-1$ } }); GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); gridData.widthHint = 150; // only expand further if anyone else requires it link.setLayoutData(gridData); addFiller(contents); }
/* * (non-Javadoc) * * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ @Override protected Control createDialogArea(Composite parent) { checkNetworkStatus(); GridData layoutData = new GridData(GridData.FILL_BOTH); Composite composite = new Composite(parent, SWT.BORDER); GridLayout layout = new GridLayout(); composite.setLayout(layout); composite.setLayoutData(layoutData); tableViewerCreator = new TableViewerCreator<ModuleToInstall>(composite); tableViewerCreator.setCheckboxInFirstColumn(false); tableViewerCreator.setColumnsResizableByDefault(true); tableViewerCreator.setLinesVisible(true); tableViewerCreator.setLayoutMode(LAYOUT_MODE.CONTINUOUS); tableViewerCreator.createTable(); createJarNameColumn(); createModuleNameColumn(); createContextColumn(); createRequiredColumn(); createLicenseColumn(); urlcolumn = createMoreInformationColumn(); installcolumn = createActionColumn(); tableViewerCreator.init(inputList); addInstallButtons(); layoutData = new GridData(GridData.FILL_BOTH); tableViewerCreator.getTable().setLayoutData(layoutData); tableViewerCreator.getTable().pack(); Composite footComposite = new Composite(composite, SWT.NONE); layoutData = new GridData(GridData.FILL_HORIZONTAL); footComposite.setLayoutData(layoutData); layout = new GridLayout(); layout.numColumns = 2; footComposite.setLayout(layout); final Link moreInfor = new Link(footComposite, SWT.NONE); layoutData = new GridData(GridData.FILL_HORIZONTAL); layoutData.widthHint = 200; moreInfor.setText(Messages.getString("ExternalModulesInstallDialog_MoreInfor")); // $NON-NLS-1$ moreInfor.setLayoutData(layoutData); moreInfor.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { // // Program.launch(Messages.getString("download.external.dialog.help.url")); // //$NON-NLS-1$ openURL(Messages.getString("download.external.dialog.help.url")); // $NON-NLS-1$ } }); setupColumnSortListener(); createFooter(composite); setTitle(title); return composite; }
public void createPartControl(Composite parent) { Composite top = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; top.setLayout(layout); // top banner Composite banner = new Composite(top, SWT.NONE); banner.setLayoutData( new GridData( GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false)); layout = new GridLayout(); layout.marginHeight = 5; layout.marginWidth = 10; layout.numColumns = 2; banner.setLayout(layout); // setup bold font Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); Label l = new Label(banner, SWT.WRAP); l.setText("Subject:"); l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("This is a message about the cool Eclipse RCP!"); l = new Label(banner, SWT.WRAP); l.setText("From:"); l.setFont(boldFont); final Link link = new Link(banner, SWT.NONE); link.setText("<a>[email protected]</a>"); link.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { MessageDialog.openInformation( getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now."); } }); l = new Label(banner, SWT.WRAP); l.setText("Date:"); l.setFont(boldFont); l = new Label(banner, SWT.WRAP); l.setText("10:34 am"); // message contents Text text = new Text(top, SWT.MULTI | SWT.WRAP); text.setText( "This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n" + "- add a top-level menu and toolbar with actions\n" + "- add keybindings to actions\n" + "- create views that can't be closed and\n" + " multiple instances of the same view\n" + "- perspectives with placeholders for new views\n" + "- use the default about dialog\n" + "- create a product definition\n"); text.setLayoutData(new GridData(GridData.FILL_BOTH)); }
private void createWarning(Composite container) { warningImg = new Label(container, SWT.CENTER); warningLink = new Link(container, SWT.NONE); warningLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(warningImg); warningImg.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING)); warningLink.setText( "Some selected dependencies can not be resolved. Click <a>here</a> to configure repositories in your settings.xml."); warningLink.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { openSettingsRepositoriesWizard(); } private void openSettingsRepositoriesWizard() { ConfigureMavenRepositoriesWizard wizard = new ConfigureMavenRepositoriesWizard(); WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard); dialog.create(); dialog.open(); } public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } }); }
@Override protected org.eclipse.swt.widgets.Control createContents( org.eclipse.swt.widgets.Composite parent) { org.eclipse.swt.widgets.Composite settingComposite = new org.eclipse.swt.widgets.Composite(parent, org.eclipse.swt.SWT.NONE); org.eclipse.swt.layout.GridLayout layout = new org.eclipse.swt.layout.GridLayout(); org.eclipse.swt.layout.GridData gd; layout.numColumns = 1; layout.marginHeight = 0; layout.marginWidth = 0; gd = new org.eclipse.swt.layout.GridData(org.eclipse.swt.layout.GridData.BEGINNING); settingComposite.setLayout(layout); settingComposite.setLayoutData(gd); org.eclipse.swt.widgets.Link link = new org.eclipse.swt.widgets.Link(settingComposite, org.eclipse.swt.SWT.NONE); link.setText( "Go to <A href=\"http://www.emftext.org\">www.emftext.org</A> for more information."); link.setSize(140, 40); link.addSelectionListener( new org.eclipse.swt.events.SelectionListener() { public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { if (e.text.startsWith("http")) org.eclipse.swt.program.Program.launch(e.text); } public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {} }); return settingComposite; }
@Override protected Control buildControl(Composite composite) { Composite control = new Composite(composite, SWT.NONE); control.setLayout(new RowLayout(SWT.VERTICAL)); Label text = new Label(control, SWT.HORIZONTAL | SWT.WRAP); text.setLayoutData(new RowData(400, 70)); text.setText(Messages.Wizard_Osm_Info); Link link = new Link(control, SWT.BORDER); link.setText(Messages.Wizard_Osm_InfoLink); link.setLayoutData(new RowData(400, 40)); link.addListener( SWT.Selection, new Listener() { public void handleEvent(Event event) { Program.launch("http://www.openstreetmap.org/"); // $NON-NLS-1$ } }); imageCache = new ImageRegistry(composite.getDisplay()); ImageDescriptor desc = ImageDescriptor.createFromFile(getClass(), OSMControl.IMG_OSM); imageCache.put(OSMControl.IMG_OSM, desc); Composite imgControl = new Composite(control, SWT.NONE); imgControl.setLayoutData(new RowData(300, 100)); imgControl.setBackgroundImage(imageCache.get(OSMControl.IMG_OSM)); this.control = control; return control; }
/** * Creates the control. * * @param parent The parent composite * @return The created control */ public Control createControl(Composite parent) { _group = new Group(parent, SWT.NONE); _group.setFont(parent.getFont()); _group.setLayout(_wizardPage.initGridLayout(new GridLayout(2, false), true)); _group.setText(Messages.NewBlackBerryProjectWizardPageOne_JREGroup_title); _useProjectRE.doFillIntoGrid(_group, 1); Combo comboControl = _RECombo.getComboControl(_group); comboControl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false)); Control[] controls = _useDefaultRE.doFillIntoGrid(_group, 1); // Fixed IDT 233814, make sure there is enough room to display the label if user change // default JRE from java to BB GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.minimumWidth = 260; controls[0].setLayoutData(gd); _preferenceLink = new Link(_group, SWT.NONE); _preferenceLink.setFont(_group.getFont()); _preferenceLink.setText(Messages.NewBlackBerryProjectWizardPageOne_JREGroup_link_description); _preferenceLink.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false)); _preferenceLink.addSelectionListener(this); setDefaultButtonState(); return _group; }
/* * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite) */ @Override protected Control createButtonBar(Composite parent) { GridLayout layout = new GridLayout(1, false); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); Composite buttonBar = new Composite(parent, SWT.NONE); buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); buttonBar.setLayout(layout); /* Status Label */ fStatusLabel = new Link(buttonBar, SWT.NONE); applyDialogFont(fStatusLabel); fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); if (StringUtils.isSet(fBookmark.getName())) fStatusLabel.setText(fBookmark.getName()); /* Close */ Button closeButton = createButton(buttonBar, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false); closeButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { close(); } }); return buttonBar; }
protected void setValidationMessage(String message) { icon.setVisible(message != null); hintText.setVisible(message != null); hintText.setText(StringUtil.nullAsEmpty(message)); topControl.getParent().layout(); }
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); StringFieldEditor token = new StringFieldEditor( Activator.PREF_SECURITY_TOKEN, "Chemspider Security Token (get one at:", parent); Link link = new Link(parent, SWT.UNDERLINE_LINK); link.setText("<a>http://www.chemspider.com/AboutServices.aspx</a>)"); link.addMouseListener( new MouseAdapter() { @Override public void mouseDown(MouseEvent me) { try { // Open default external browser PlatformUI.getWorkbench() .getBrowserSupport() .getExternalBrowser() .openURL(new URL("http://www.chemspider.com/AboutServices.aspx")); } catch (PartInitException ex) { logger.error(ex.getMessage(), ex); } catch (MalformedURLException ex) { logger.error(ex.getMessage(), ex); } } }); StringFieldEditor endpoint = new StringFieldEditor( Activator.PREF_SERVER_ENDPOINT, "Chemspider server endpoint", getFieldEditorParent()); addField(token); addField(endpoint); }
@Override protected Control createContents(final Composite parent) { noDefaultAndApplyButton(); final Composite panel = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); layout.numColumns = 2; panel.setLayout(layout); final Label img = new Label(panel, SWT.NONE); img.setLayoutData(new GridData(79, SWT.DEFAULT)); img.setImage( ResourceManager.getPluginImage(ErlideUIPlugin.PLUGIN_ID, "icons/full/obj16/erlang058.gif")); final Group composite = new Group(panel, SWT.NONE); final GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, false, false); gd_composite.widthHint = 356; composite.setLayoutData(gd_composite); composite.setLayout(new GridLayout()); final Label text = new Label(composite, SWT.NONE); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); text.setToolTipText("Vlad Dumitrescu, Jakob Cederlund and others"); text.setText(PreferenceMessages.ErlangPreferencePage_2); final Label textv = new Label(composite, SWT.NONE); textv.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); final String version = ErlangPlugin.getDefault().getCore().getFeatureVersion(); textv.setText(" version " + version); final Link erlideorgLink = new Link(composite, SWT.NONE); erlideorgLink.setText(PreferenceMessages.ErlangPreferencePage_3); final Link updateLink = new Link(composite, SWT.NONE); updateLink.setText(PreferenceMessages.ErlangPreferencePage_4); new Label(panel, SWT.NONE); final Button reportButton = new Button(panel, SWT.NONE); reportButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn( getShell(), "org.erlide.ui.reporting", null, null); } }); reportButton.setText("Report problems"); new Label(panel, SWT.NONE); txtLocalErlangNodes = new Text(panel, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI); txtLocalErlangNodes.setText( "This machine supports local Erlang nodes with only short names \nbecause of its hostname configuration. \n\nTo enable long names locally, make sure that the machine \nhas a proper FQDN on the network. "); final GridData gd_txtLocalErlangNodes = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1); gd_txtLocalErlangNodes.widthHint = 339; gd_txtLocalErlangNodes.heightHint = 87; txtLocalErlangNodes.setLayoutData(gd_txtLocalErlangNodes); txtLocalErlangNodes.setVisible(false); return panel; }
@Override protected Control createDialogArea(final Composite parent) { final Composite composite = (Composite) super.createDialogArea(parent); final Link url1 = new Link(composite, SWT.BORDER); url1.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); url1.setText(message); return composite; }
private void createControl(final Composite parent) { Composite comp = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.BEGINNING).applyTo(comp); GridLayoutFactory.fillDefaults() .numColumns(isCentered ? 1 : 2) .margins(margin.x, margin.y) .applyTo(comp); updateStatusLabel = new Link(comp, SWT.NO_FOCUS); if (backgroundColor != null) { comp.setBackground(backgroundColor); updateStatusLabel.setBackground(backgroundColor); } updateStatusLabel.addSelectionListener( new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } @Override public void widgetSelected(SelectionEvent e) { ExternalBrowserUtil.openInExternalBrowser(UpdateCore.getChangeLogUrl()); } }); GridDataFactory.fillDefaults() .align(isCentered ? SWT.CENTER : SWT.FILL, SWT.CENTER) .grab(true, false) .applyTo(updateStatusLabel); updateStatusButton = new Button(comp, SWT.PUSH); updateStatusButton.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); GridDataFactory.fillDefaults() .align(SWT.CENTER, SWT.CENTER) .indent(0, 3) .applyTo(updateStatusButton); updateStatusButton.addSelectionListener( new SelectionListener() { @Override public void widgetDefaultSelected(SelectionEvent e) { performAction(e); } @Override public void widgetSelected(SelectionEvent e) { performAction(e); } }); }
private void setLinkText() { PropertyList propList = entity.getProperties(type.getId()); savedProp = propList != null ? propList.getProperty(0) : null; if (savedProp == null) { savedProp = entity.createNewProperty(type, ""); // $NON-NLS-1$ } if (savedProp.getPropertyValue() != null) { link.setText(savedProp.getPropertyValue()); } link.pack(); }
protected void createLink(Composite composite, String linkText) { Link link = new Link(composite, SWT.NONE); link.setText(linkText); link.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ShowSecurityPreferencesAction action = new ShowSecurityPreferencesAction(); action.run(); } }); }
/* * (non-Javadoc) * * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) */ protected Control createContents(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); link = new Link(comp, SWT.NONE); link.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false)); link.setFont(comp.getFont()); link.setText(PDEUIMessages.CompilersPreferencePage_configure_project_specific_settings); link.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { HashSet set = new HashSet(); try { IJavaProject[] projects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects(); IProject project = null; for (int i = 0; i < projects.length; i++) { project = projects[i].getProject(); try { if (project.hasNature(PDE.PLUGIN_NATURE) && fBlock.hasProjectSpecificSettings(project)) { set.add(projects[i]); } } catch (CoreException ce) { // do nothing ignore the project } } } catch (JavaModelException jme) { // ignore } ProjectSelectionDialog psd = new ProjectSelectionDialog(getShell(), set); if (psd.open() == IDialogConstants.OK_ID) { HashMap data = new HashMap(); data.put(NO_LINK, Boolean.TRUE); PreferencesUtil.createPropertyDialogOn( getShell(), ((IJavaProject) psd.getFirstResult()).getProject(), "org.eclipse.pde.internal.ui.properties.compilersPropertyPage", //$NON-NLS-1$ new String[] {"org.eclipse.pde.internal.ui.properties.compilersPropertyPage"}, data) .open(); //$NON-NLS-1$ } } }); fBlock = new PDECompilersConfigurationBlock(null, (IWorkbenchPreferenceContainer) getContainer()); fBlock.createControl(comp); // Initialize with data map in case applyData was called before createContents applyData(fPageData); return comp; }
/** * Creates the Quartz controls. * * @param parent the parent * @param editorStyle true to use the editor style, false for wizards */ public void createControls(final Composite parent, boolean editorStyle) { Label l = SwtFactory.createLabel( parent, Messages.cronExpression, "A CRON expression to schedule service invocations"); if (editorStyle) l.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE)); this.cronText = SwtFactory.createSimpleTextField(parent, true); Link cronLink = new Link(parent, SWT.NONE); cronLink.setText("<A>" + Messages.cronHelp + "</A>"); cronLink.setLayoutData(new GridData(SWT.RIGHT, SWT.DEFAULT, true, false, 2, 1)); cronLink.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { try { final IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser(); browser.openURL( new URL( "http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger")); } catch (Exception ex) { PetalsQuartzPlugin.log(ex, IStatus.ERROR); new ErrorDialog( parent.getShell(), Messages.couldNotOpenEditorTitle, Messages.couldNotOpenEditorMessage, new Status(IStatus.ERROR, PetalsQuartzPlugin.PLUGIN_ID, ex.getMessage()), 0) .open(); } } }); // The message skeleton l = SwtFactory.createLabel( parent, Messages.content, "A XML message to send to the target service"); GridDataFactory.swtDefaults().indent(0, 5).span(2, 1).applyTo(l); if (editorStyle) l.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE)); this.msgText = SwtFactory.createXmlTextViewer(parent); GridDataFactory.swtDefaults() .align(SWT.FILL, SWT.FILL) .grab(true, true) .span(2, 1) .applyTo(this.msgText.getParent()); }
private static void createLinkToGlobal(final Composite ancestor, Composite parent) { Link fLink = new Link(parent, SWT.NONE); fLink.setText("<A>Configure Workspace Settings...</A>"); fLink.setLayoutData(new GridData()); SelectionAdapter sl = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(ancestor.getShell(), PREFERENCE_ID, null, null) .open(); } }; fLink.addSelectionListener(sl); }
@Override public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); final TabbedPropertySheetWidgetFactory factory = getWidgetFactory(); _panel = factory.createComposite(parent); _panel.setLayout(new GridLayout(3, false)); _newBPELLink = new Link(_panel, SWT.NONE); _newBPELLink.setText("<a>BPEL File:</a>"); _newBPELLink.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { openFile(); } }); _bpelFileText = factory.createText(_panel, "", SWT.READ_ONLY); _bpelFileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); _bpelFileText.addModifyListener( new ModifyListener() { @Override public void modifyText(ModifyEvent event) { final QName newValue = _bpelFileText.getText().length() == 0 ? null : QName.valueOf(_bpelFileText.getText()); if (!_updating && ((newValue == null && _implementation.getProcess() != null) || (newValue != null && !newValue.equals(_implementation.getProcess())))) { wrapOperation( new Runnable() { public void run() { _implementation.setProcess(newValue); } }); } } }); _browseBPELButton = factory.createButton(_panel, "Browse...", SWT.PUSH); _browseBPELButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { handleBrowse(); } }); }
/* * Creates a help link. This is used when there is no help image * available. */ private Link createLocalizationLink(Composite parent) { Link link = new Link(parent, SWT.WRAP | SWT.NO_FOCUS); ((GridLayout) parent.getLayout()).numColumns++; link.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, false)); link.setText("<a>" + IDialogConstants.HELP_LABEL + "</a>"); // $NON-NLS-1$ //$NON-NLS-2$ link.setToolTipText(IDialogConstants.HELP_LABEL); link.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { localizationPressed(); } }); return link; }
private void createSwitchEditorControl(final TabbedPropertySheetWidgetFactory widgetFactory) { ((GridLayout) control.getLayout()).numColumns++; final Link switchControl = new Link(mc, SWT.NONE); switchControl.setLayoutData(GridDataFactory.fillDefaults().indent(15, 0).create()); switchControl.setText(Messages.switchEditorCondition); switchControl.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { switchEditorType(); } }); }
@Override public void createControl(Composite parent) { setTitle("Identify Maven dependencies"); initImages(); Composite container = new Composite(parent, SWT.NONE); container.setEnabled(true); setControl(container); GridLayout layout = new GridLayout(3, false); layout.marginLeft = 12; container.setLayout(layout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); setMessage(MESSAGE); createWarning(container); displayDependenciesTable(container); Link remoteRepoPrefsLink = new Link(container, SWT.NONE); remoteRepoPrefsLink.setText("Manage <a>remote repositories</a> used to identify dependencies."); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1); remoteRepoPrefsLink.setLayoutData(gd); remoteRepoPrefsLink.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { openRemoteRepoPrefs(); } public void widgetDefaultSelected(SelectionEvent e) { widgetSelected(e); } }); deleteJars = dialogSettings.getBoolean("isDeleteJars"); deleteJarsBtn = addCheckButton(container, "Delete original references from project", deleteJars); deleteJarsBtn.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { deleteJars = deleteJarsBtn.getSelection(); } }); runIdentificationJobs(null); }
public void create() { label = new Label(parent, SWT.NULL); String labelText = type.getName(); if (showValidationHint && useValidationGUIHints) { refontLabel(true); } label.setText(type.getName()); Composite container = new Composite(parent, SWT.NULL); GridLayout contLayout = new GridLayout(3, false); contLayout.horizontalSpacing = 5; contLayout.marginLeft = 0; contLayout.marginWidth = 0; contLayout.marginHeight = 0; container.setLayout(contLayout); GridData containerLData = new GridData(); containerLData.horizontalAlignment = GridData.FILL; containerLData.grabExcessHorizontalSpace = true; container.setLayoutData(containerLData); link = new Link(container, SWT.NONE); link.setToolTipText(this.type.getTooltiptext()); link.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 1, 1)); link.addListener( SWT.Selection, new Listener() { public void handleEvent(Event event) { if (getHref() != null && getHref().length() > 0) Program.launch(getHref()); } }); Button editBtn = new Button(container, SWT.PUSH); editBtn.setText(Messages.getString("URLControl.1")); // $NON-NLS-1$ editBtn.setToolTipText(this.type.getTooltiptext()); editBtn.setEnabled(editable); editBtn.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent arg0) { showLinkEditDialog(); } public void widgetDefaultSelected(SelectionEvent arg0) { showLinkEditDialog(); } }); setLinkText(); }
protected void createLinksPanel(Composite composite) { final DriverDescriptor driver = getWizard().getDriver(); // UIUtils.createPlaceholder(composite, 1).setLayoutData(new GridData(GridData.FILL_BOTH)); Composite linksGroup = UIUtils.createPlaceholder(composite, 2); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.verticalIndent = 10; linksGroup.setLayoutData(gd); // Vendor site if (!CommonUtils.isEmpty(driver.getWebURL())) { Link link = UIUtils.createLink( linksGroup, "<a>Vendor's website</a>", new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { RuntimeUtils.openWebBrowser(driver.getWebURL()); } }); link.setToolTipText(driver.getWebURL()); link.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_BEGINNING)); } else { UIUtils.createPlaceholder(linksGroup, 1) .setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } Link link = UIUtils.createLink( linksGroup, "<a>Download configuration</a>", new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { UIUtils.showPreferencesFor(null, null, PrefPageDrivers.PAGE_ID); } }); link.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END)); }
@Override protected Control createContents(Composite parent) { Link link = new Link(parent, SWT.NONE); link.setText(ARMExplorerPreferenceConstants.PREFERENCE_ACCOUNT_INFO_MESSAGE); link.addListener( SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { // Open Azure Account info article with default Browser. Program.launch(event.text); } }); return super.createContents(parent); };
private void createTextEditorLink(Composite appearanceComposite) { // Link to general text editor prefs from Eclipse - they can set tabs/spaces/whitespace drawing, // etc Link link = new Link(appearanceComposite, SWT.NONE); link.setText(Messages.EditorsPreferencePage_GeneralTextEditorPrefLink); link.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ((IWorkbenchPreferenceContainer) getContainer()) .openPage(GENERAL_TEXT_EDITOR_PREF_ID, null); } }); }
private Link createLink(Composite composite, String text) { Link link = new Link(composite, SWT.NONE); link.setFont(composite.getFont()); link.setText("<A>" + text + "</A>"); // $NON-NLS-1$//$NON-NLS-2$ link.addSelectionListener( new SelectionListener() { public void widgetSelected(SelectionEvent e) { openLink(); } public void widgetDefaultSelected(SelectionEvent e) { openLink(); } }); return link; }
@Override public void createControl(Composite parent) { Color background = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); composite.setBackground(background); Link link = new Link(composite, SWT.NONE); link.setText(SearchMessages.SearchView_empty_search_label); link.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, true, false)); link.setBackground(background); fControl = composite; }
private Link createHelpLink(Composite parent) { Link link = new Link(parent, SWT.WRAP | SWT.NO_FOCUS); ((GridLayout) parent.getLayout()).numColumns++; link.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); link.setText("<a>" + IDialogConstants.HELP_LABEL + "</a>"); // $NON-NLS-1$ //$NON-NLS-2$ link.setToolTipText(IDialogConstants.HELP_LABEL); link.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { helpPressed(); } }); return link; }
private void addCharacterEncodingLabel(Composite composite) { final Link link = new Link(composite, SWT.NONE); try { link.setText( "Default source file encoding: " + getSelectedProject().getDefaultCharset() + " <a>(Change...)</a>"); link.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { IWorkbenchPreferenceContainer container = (IWorkbenchPreferenceContainer) getContainer(); container.openPage("org.eclipse.ui.propertypages.info.file", null); } }); getWorkspace() .addResourceChangeListener( encodingListener = new IResourceChangeListener() { @Override public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { Display.getDefault() .asyncExec( new Runnable() { public void run() { try { if (!link.isDisposed()) { link.setText( "Default source file encoding: " + getSelectedProject().getDefaultCharset() + " <a>(Change...)</a>"); } } catch (CoreException e) { e.printStackTrace(); } } }); } } }); } catch (CoreException e) { e.printStackTrace(); } }