/** * 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 ); } } ); } }
/** * build plugin info cell. */ protected void buildPluginInfoCell() { this.ascLink = new Link( this.dialog, SWT.NONE ); this.ascLink.setText( BaseMessages.getString( PKG, "SapInputDialog.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 ); } } ); } }
/** * build plugin info cell. */ protected void buildPluginInfoCell() { this.ascLink = new Link( this.dialog, SWT.NONE ); this.ascLink.setText( BaseMessages.getString( PKG, "OlapInputDialog.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 ); } } ); } }
this.wAscLink.addListener( SWT.Selection, new Listener() { public void handleEvent( final Event event ) { Program.launch( event.text );
private static void setLinkTarget(Link link, final String target) { link.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { Program.launch(target); } }); }
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 ); } } } } ); }
this.wAbout.addListener( SWT.Selection, lsAbout ); this.wAscLink.addListener( SWT.Selection, new Listener() { public void handleEvent( final Event event ) { Program.launch( event.text );
this.wAscLink.addListener( SWT.Selection, new Listener() { public void handleEvent( final Event event ) { Program.launch( event.text );
.setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wGaCustomProfileReference ); wGaCustomProfileReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wQuDimensionsReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wQuMetricsReference.setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wQuMetricsReference ); wQuMetricsReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wQuFiltersReference.setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wQuFiltersReference ); wQuFiltersReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { wQuSortReference.setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) ); props.setLook( wQuSortReference ); wQuSortReference.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event ev ) { .setText( BaseMessages.getString( PKG, "GoogleAnalyticsDialog.Query.Reference.Label" ) );
/** Adds a listener. */ public void addListener(int eventType, Listener listener) { wrapped.addListener(eventType, listener); }
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection, typedListener); addListener (SWT.DefaultSelection, typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection, typedListener); addListener (SWT.DefaultSelection, typedListener);
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection, typedListener); addListener (SWT.DefaultSelection, typedListener);
addListener( SWT.Selection, typedListener ); addListener( SWT.DefaultSelection, typedListener );
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener (listener); addListener (SWT.Selection, typedListener); addListener (SWT.DefaultSelection, typedListener);
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 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 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; }
/** * Creates a link * * @param parent the parent composite * @param style the type * @param text the text * @param horizontalAlignment the horizontal alignment of the text * @param horizontalSpan the horizontal span * @param verticalSpan the vertical span * @param listener the listener * @return the link */ public static Link createLink(Composite parent, int style, String text, int horizontalAlignment, int horizontalSpan, int verticalSpan, Listener listener) { Link link = new Link(parent, style); GridData gridData = new GridData(horizontalAlignment, SWT.CENTER, false, false, horizontalSpan, verticalSpan); link.setLayoutData(gridData); if (text != null) { link.setText(text); } if (listener != null) { link.addListener(SWT.Selection, listener); } setItalicFont(parent.getDisplay(), link); return link; }
protected void addButtonsToHelpControl(Control control) { Composite parent = control.getParent(); if (control instanceof ToolBar) { ToolBar toolBar = (ToolBar) control; ToolItem importButton = new ToolItem(toolBar, SWT.PUSH); importImage = WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_PREF_IMPORT) .createImage(); importButton.setImage(importImage); importButton.setToolTipText(WorkbenchMessages.Preference_import); importButton.addListener(SWT.Selection, e -> openImportWizard(parent)); ToolItem exportButton = new ToolItem(toolBar, SWT.PUSH); exportImage = WorkbenchImages.getImageDescriptor(IWorkbenchGraphicConstants.IMG_PREF_EXPORT) .createImage(); exportButton.setImage(exportImage); exportButton.setToolTipText(WorkbenchMessages.Preference_export); exportButton.addListener(SWT.Selection, e -> openExportWizard(parent)); } else if (control instanceof Link) { Composite linkParent = ((Link) control).getParent(); Link importLink = new Link(linkParent, SWT.WRAP | SWT.NO_FOCUS); ((GridLayout) parent.getLayout()).numColumns++; importLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); importLink.setText(" <a>" + WorkbenchMessages.Preference_import + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$ importLink.addListener(SWT.Selection, e -> openImportWizard(parent)); Link exportLink = new Link(linkParent, SWT.WRAP | SWT.NO_FOCUS); ((GridLayout) parent.getLayout()).numColumns++; exportLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); exportLink.setText(" <a>" + WorkbenchMessages.Preference_export + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$ exportLink.addListener(SWT.Selection, e -> openExportWizard(parent)); } }