Link lblNewLabel = new Link(composite, SWT.NONE); lblNewLabel.addSelectionListener(openUrl); lblNewLabel.setFont(SWTResourceManager.getFont("Arial", 20, SWT.NORMAL)); lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); lblNewLabel.setBounds(0, 0, 61, 17); lblNewLabel.setText("<a href=\"https://github.com/caoxinyu/RedisClient\">RedisClient for Windows</a>"); lblNewLabel_3.setText(RedisClient.i18nFile.getText(I18nFile.DEVELOPER)); Link link = new Link(composite, SWT.NONE); link.addSelectionListener(openUrl); link.setText("<a href=\"mailto:caoxinyu@gmail.com\">" + RedisClient.i18nFile.getText(I18nFile.CAOXINYU) + "</a>"); new Label(composite, SWT.NONE); lblReportIssue.setText(RedisClient.i18nFile.getText(I18nFile.ISSUE)); Link link_1 = new Link(composite, SWT.NONE); link_1.addSelectionListener(openUrl); link_1.setText("<a href=\"https://github.com/caoxinyu/redisclient/issues?state=open\">" + RedisClient.i18nFile.getText(I18nFile.CLICK) + "</a>"); new Label(composite, SWT.NONE); lblStar.setText(RedisClient.i18nFile.getText(I18nFile.STAR)); Link link_2 = new Link(composite, SWT.NONE); link_2.addSelectionListener(openUrl); link_2.setText("<a href=\"https://github.com/caoxinyu/RedisClient/stargazers\">" + RedisClient.i18nFile.getText(I18nFile.CLICK) + "</a>");
/** * build plugin info cell. */ protected void buildPluginInfoCell() { this.ascLink = new Link( this.dialog, SWT.NONE ); this.ascLink.setText( BaseMessages.getString( PKG, "TeraFastDialog.About.Plugin.Info" ) ); GridData grdData = new GridData(); grdData.horizontalIndent = DEFAULT_INDENT; grdData.verticalIndent = DEFAULT_INDENT; this.ascLink.setLayoutData( grdData ); this.ascLink.addListener( SWT.Selection, new Listener() { public void handleEvent( final Event event ) { Program.launch( event.text ); } } ); } }
/** * @param factory * factory to use. */ protected void buildAscLink( final PluginWidgetFactory factory ) { final Control topControl = this.wReturn; this.wAscLink = new Link( this.shell, SWT.NONE ); this.wAscLink.setText( BaseMessages.getString( PKG, "TeraFastDialog.Provided.Info" ) ); FormData formData = factory.createLabelLayoutData( topControl ); formData.right = null; this.wAscLink.setLayoutData( formData ); }
private void setHelpLink( Display display, String helpLink, int maxTextWidth, EnvironmentCase environment ) { link = new Link( shell, SWT.SINGLE | SWT.WRAP ); link.setText( helpLink ); if ( environment == EnvironmentCase.MAC_OS_X || environment == EnvironmentCase.MAC_OS_X_THIN ) { FontData[] fD = link.getFont().getFontData(); fD[0].setHeight( 13 ); link.setFont( new Font( display, fD[0] ) ); } FormData fdlink = new FormData(); fdlink.left = new FormAttachment( warningIcon, margin ); // Link should be below description right of icon fdlink.top = new FormAttachment( description, margin ); fdlink.width = maxTextWidth; link.setLayoutData( fdlink ); props.setLook( link ); link.addListener( SWT.Selection, new Listener() { public void handleEvent( Event event ) { if ( Desktop.isDesktopSupported() ) { try { Desktop.getDesktop().browse( new URI( Const.getDocUrl( URI_PATH ) ) ); } catch ( Exception e ) { log.logError( "Error opening external browser", e ); } } } } ); }
private void createPreferencePageLink(Composite composite, String label, final Map<String, String> targetInfo) { final Link link= new Link(composite, SWT.NONE); link.setText(label); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, targetInfo); } }); }
public static Link createMethodLink(final Composite parent, final IMethod method, final EventBus workspaceBus) { final String text = "<a>" //$NON-NLS-1$ + JavaElementLabels.getElementLabel(method, JavaElementLabels.M_APP_RETURNTYPE | JavaElementLabels.M_PARAMETER_TYPES) + "</a>"; //$NON-NLS-1$ final String tooltip = JavaElementLabels.getElementLabel(method, JavaElementLabels.DEFAULT_QUALIFIED); final Link link = new Link(parent, SWT.NONE); link.setText(text); link.setBackground(ExtdocUtils.createColor(SWT.COLOR_INFO_BACKGROUND)); link.setToolTipText(tooltip); link.setFont(JFaceResources.getDialogFont()); link.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { final JavaSelectionEvent event = new JavaSelectionEvent(method, METHOD_DECLARATION); workspaceBus.post(event); } }); return link; }
private Link createLink(Composite parent, IAction action, String text) { Link link = new Link(parent, SWT.PUSH); link.setText(text); link.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { IAction linkAction = getLinkAction(event.widget); if (linkAction != null) { linkAction.runWithEvent(event); } } }); link.setToolTipText(action.getToolTipText()); link.setData(LINKACTION, action); return link; }
private Link createLink(Composite composite, ListenerMix listener) { Link link= new Link(composite, SWT.WRAP); GridData layoutData= new GridData(SWT.FILL, SWT.CENTER, true, false); layoutData.widthHint= convertWidthInCharsToPixels(80); link.setLayoutData(layoutData); link.addSelectionListener(listener); return link; }
public void setStatusWithCallback(final String statusMessage, final SelectionListener listener) { disposeChildren(status); final Link link = new Link(status, SWT.NONE); link.setText(statusMessage); link.setBackground(link.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); link.addSelectionListener(listener); layout(); } }
link = new Link(this, SWT.NONE); link.setLayoutData(linkData); link.addSelectionListener(widgetSelectedAdapter(e -> executeTrigger())); link.addListener(SWT.Resize, event -> { Object text = link.getData(TEXT_KEY); if (text == null) return; if (link.getData(TRIGGER_KEY) == null && (taskString == null || taskString.equals(getMainTitle()))) { link.setToolTipText(taskString); link.setData(TEXT_KEY, taskString);
wGaCustomProfileReference = new Link( gConnect, SWT.SINGLE ); wGaCustomProfileReference .setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wGaCustomProfileReference ); wGaCustomProfileReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wGaCustomProfileReference.pack( true ); fdGaCustomProfile.right = new FormAttachment( 100, -wGaCustomProfileReference.getBounds().width - margin ); wGaCustomProfile.setLayoutData( fdGaCustomProfile ); fdGaCustomProfileReference.left = new FormAttachment( wGaCustomProfile, 0 ); fdGaCustomProfileReference.right = new FormAttachment( 100, 0 ); wGaCustomProfileReference.setLayoutData( fdGaCustomProfileReference ); wQuDimensionsReference = new Link( gQuery, SWT.SINGLE ); wQuDimensionsReference.setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wQuDimensionsReference ); wQuDimensionsReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wQuDimensionsReference.pack( true ); fdQuDimensions.right = new FormAttachment( 100, -wQuDimensionsReference.getBounds().width - margin ); wQuDimensions.setLayoutData( fdQuDimensions );
private void setupUpdateStuff(final Composite parentComposite) { Link updatesAvailableLink = new Link(parentComposite, SWT.VERTICAL); // updatesAvailableLink.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true)); updatesAvailableLink.setVisible(false); updatesAvailableLink.setText(UPDATE_AVAILABLE); updatesAvailableLink.addSelectionListener(new UrlLauncher(TVRENAMER_DOWNLOAD_URL)); // Show the label if updates are available (in a new thread) UpdateChecker.notifyOfUpdate(updateIsAvailable -> { if (updateIsAvailable) { display.asyncExec(() -> updatesAvailableLink.setVisible(true)); } }); }
websiteLink = new Link(themeDetails, SWT.NONE); GridDataFactory.swtDefaults().grab(true, false).applyTo(websiteLink); updateDetails(colorThemeManager.getTheme(activeThemeName)); Link ectLink = new Link(container, SWT.NONE); ectLink.setText("Download more themes or create your own on " + "<a>eclipsecolorthemes.org</a>."); setLinkTarget(ectLink, "http://eclipsecolorthemes.org");
Link link = new Link(container, SWT.PUSH); link.setText(ProvSDKMessages.ProvisioningPreferencePage_UninstallUpdateLink); link.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { ProvUI.openInstallationDialog(event);
/** * Creates the link control to show a hyperlink to the Keys * preference page. * * @param parent the parent control. Not <code>null</code>. * @param text the text of the link * @return the link control. Not <code>null</code>. */ protected Link createLink(final Composite parent, final String text) { final Link link = new Link(parent, SWT.NONE); link.setFont(parent.getFont()); link.setText("<A>" + text + "</A>"); //$NON-NLS-1$//$NON-NLS-2$ configureFormData(link); configureBigFont(link); link.addFocusListener(new FocusAdapter() { @Override public void focusGained(final FocusEvent e) { doLinkActivated(); } }); return link; }
checkWidget (); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection, typedListener); addListener (SWT.DefaultSelection, typedListener);
private void updateMatchLocationText() { if (fMatchLocationsLink != null) { int searchFor= getSearchFor(); int totNum= MatchLocations.getTotalNumberOfSettings(searchFor); int currNum= MatchLocations.getNumberOfSelectedSettings(fMatchLocations, searchFor); fMatchLocationsLink.setText(Messages.format(SearchMessages.JavaSearchPage_match_location_link_label, new Object[] { Integer.valueOf(currNum), Integer.valueOf(totNum) })); fMatchLocationsLink.setToolTipText(SearchMessages.JavaSearchPage_match_location_link_label_tooltip); } }
@Override void doSetStringValue(Object source, String value) { ((Link) source).setText(value == null ? "" : value); //$NON-NLS-1$ }
private void updateDetails(ColorTheme theme) { if (theme == null) themeDetails.setVisible(false); else { authorLabel.setText("Created by " + theme.getAuthor()); String website = theme.getWebsite(); if (website == null || website.length() == 0) websiteLink.setVisible(false); else { websiteLink.setText("<a>" + website + "</a>"); for (Listener listener : websiteLink.getListeners( SWT.Selection)) websiteLink.removeListener(SWT.Selection, listener); setLinkTarget(websiteLink, website); websiteLink.setVisible(true); } String id = theme.getId(); Browser browser = getBrowser(); if (browser != null) browser.setUrl( "http://www.eclipsecolorthemes.org/static/themes/java/" + id + ".html"); themeDetails.setVisible(true); authorLabel.pack(); websiteLink.pack(); } }
this.wAscLink.addListener( SWT.Selection, new Listener() { public void handleEvent( final Event event ) { Program.launch( event.text );