Search in sources :

Example 1 with Link

use of org.eclipse.swt.widgets.Link in project cogtool by cogtool.

the class EltGroupPropertiesPane method createWidgets.

protected void createWidgets() {
    eltGroupNameLabel = new DisplayLabel(this, SWT.NONE);
    eltGroupNameLabel.setText(groupNameLabel);
    eltGroupName = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.SetRemoteLabelText, view) {

        @Override
        protected boolean doChangeAction() {
            FrameElementGroup eltGroup = (FrameElementGroup) getData();
            FrameEditorUI.EltGroupRenameParameters evt = new FrameEditorUI.EltGroupRenameParameters(eltGroup, getText());
            boolean changed = view.performAction(FrameEditorLID.RenameEltGroup, evt, true);
            if (!changed) {
                setText(eltGroup.getName());
            }
            return changed;
        }
    };
    remoteLabel = new DisplayLabel(this, SWT.NONE);
    remoteLabel.setText(L10N.get("FE.RemoteLabelCaption", "Remote Label") + ":");
    remoteLabelFind = new Link(this, SWT.NONE);
    remoteLabelFind.setText(L10N.get("FE.RemoteLabelFind", "<a>Find</a>"));
    remoteLabelFind.setFont(FontUtils.getAdjustedFont(remoteLabelFind.getFont(), 8, SWT.BOLD));
    remoteLabelText = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.SetRemoteLabelText, view);
    auxTextLabel = new DisplayLabel(this, SWT.NONE);
    auxTextLabel.setText(L10N.get("FE.AuxTextLabelCaption", "Auxiliary Text") + ":");
    auxText = new View.PropertiesChangeText(this, SWT.SINGLE | SWT.BORDER, FrameEditorLID.ChangeAuxTextProperty, view);
    groupEltsTreeLabel = new DisplayLabel(this, SWT.NONE);
    groupEltsTreeLabel.setText(GROUP_ELTS);
    groupEltsTree = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
    groupEltsTree.setLinesVisible(true);
    groupEltsUpdater = new TreeItemUpdater.FrameEltItemUpdater(groupEltsTree);
}
Also used : FrameElementGroup(edu.cmu.cs.hcii.cogtool.model.FrameElementGroup) Tree(org.eclipse.swt.widgets.Tree) FrameEditorUI(edu.cmu.cs.hcii.cogtool.ui.FrameEditorUI) Link(org.eclipse.swt.widgets.Link) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel)

Example 2 with Link

use of org.eclipse.swt.widgets.Link in project cogtool by cogtool.

the class AboutView method addLink.

// buildDialog
protected void addLink(String label, final String url) {
    Link link = new Link(dialog, SWT.NONE);
    GridData linkLayout = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
    linkLayout.horizontalSpan = 4;
    link.setLayoutData(linkLayout);
    link.setText(label + ": <a href=\"" + url + "\">" + url + "</a>");
    link.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event evt) {
            Program.launch(url);
        }
    });
}
Also used : Listener(org.eclipse.swt.widgets.Listener) GridData(org.eclipse.swt.layout.GridData) Event(org.eclipse.swt.widgets.Event) Link(org.eclipse.swt.widgets.Link)

Example 3 with Link

use of org.eclipse.swt.widgets.Link in project tesb-studio-se by Talend.

the class InitFinishMessageDialog method createMessageArea.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
     */
@Override
protected Control createMessageArea(Composite composite) {
    // create image
    Image image = getImage();
    if (image != null) {
        imageLabel = new Label(composite, SWT.NULL);
        image.setBackground(imageLabel.getBackground());
        imageLabel.setImage(image);
        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
    }
    Link link = new Link(composite, SWT.WRAP);
    link.setText("Local runtime serview has been started, totally installed bundles: <a href=\"#\">" + bundlesName.length + "</a>.");
    link.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            ElementListSelectionDialog report = new ElementListSelectionDialog(getShell(), new LabelProvider());
            report.setTitle("Installed bundles:");
            report.setMessage("Search bundle (? = any character, * = any string):");
            report.setElements(bundlesName);
            report.open();
        }
    });
    return composite;
}
Also used : ElementListSelectionDialog(org.eclipse.ui.dialogs.ElementListSelectionDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Image(org.eclipse.swt.graphics.Image) LabelProvider(org.eclipse.jface.viewers.LabelProvider) Link(org.eclipse.swt.widgets.Link)

Example 4 with Link

use of org.eclipse.swt.widgets.Link in project azure-tools-for-java by Microsoft.

the class SDKJarsFilter method createLinks.

private void createLinks(Composite container) {
    // Privacy Link
    lnkAIPrivacy = new Link(container, SWT.RIGHT);
    GridData gridData = new GridData();
    gridData.horizontalSpan = 4;
    gridData.horizontalIndent = 10;
    gridData.verticalIndent = 5;
    lnkAIPrivacy.setText(Messages.lnkAIPrivacy);
    lnkAIPrivacy.setLayoutData(gridData);
    lnkAIPrivacy.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(event.text));
            } catch (Exception ex) {
                /*
					 * only logging the error in log file
					 * not showing anything to end user
					 */
                Activator.getDefault().log(Messages.lnkAIPrivacy, ex);
            }
        }
    });
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Link(org.eclipse.swt.widgets.Link) URL(java.net.URL) CoreException(org.eclipse.core.runtime.CoreException)

Example 5 with Link

use of org.eclipse.swt.widgets.Link in project translationstudio8 by heartsome.

the class MachineTranslationPreferencePage method createBingTranslateArea.

private Composite createBingTranslateArea(Composite tparent) {
    Group apiKeySettingGroup = new Group(tparent, SWT.NONE);
    apiKeySettingGroup.setText(Messages.getString("preference.BingPreferencePage.apiKeySettingGroup"));
    apiKeySettingGroup.setLayout(new GridLayout(1, false));
    apiKeySettingGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    HsImageLabel lbKeySetting = new HsImageLabel(Messages.getString("preference.BingPreferencePage.lbKeySetting"), Activator.getImageDescriptor("images/trans_bing_key_32.png"));
    Composite com = lbKeySetting.createControl(apiKeySettingGroup);
    com.setLayout(new GridLayout(3, false));
    Label lblId = new Label(com, SWT.NONE);
    lblId.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblId.setText(Messages.getString("preference.BingPreferencePage.lblId"));
    idText = new Text(com, SWT.BORDER);
    idText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    new Label(com, SWT.NONE);
    Label lblApiKey = new Label(com, SWT.NONE);
    lblApiKey.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblApiKey.setText(Messages.getString("preference.BingPreferencePage.lblApiKey"));
    bingKeyText = new Text(com, SWT.BORDER);
    bingKeyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    bingStateLable = new Label(com, SWT.NONE);
    bingStateLable.setImage(errorImage);
    new Label(com, SWT.NONE);
    Button validateKey = new Button(com, SWT.NONE);
    validateKey.setText(Messages.getString("preference.BingPreferencePage.validateKey"));
    validateKey.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            String id = idText.getText();
            String bingKey = bingKeyText.getText();
            if (id == null || id.equals("")) {
                MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg1"));
                return;
            }
            if (bingKey == null || bingKey.equals("")) {
                MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg2"));
                return;
            }
            bingValidator();
            setComponentsState();
            if (!bingState) {
                MessageDialog.openInformation(getShell(), Messages.getString("preference.BingPreferencePage.msgTitle"), Messages.getString("preference.BingPreferencePage.msg3"));
                return;
            }
        }
    });
    new Label(com, SWT.NONE);
    new Label(com, SWT.NONE);
    Link link = new Link(com, SWT.NONE);
    link.setText("<a>" + Messages.getString("preference.BingPreferencePage.link") + "</a>");
    link.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            Program.launch("http://msdn.microsoft.com/en-us/library/hh454950.aspx");
        }
    });
    link.setToolTipText("http://msdn.microsoft.com/en-us/library/hh454950.aspx");
    new Label(com, SWT.NONE);
    lbKeySetting.computeSize();
    return tparent;
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) HsImageLabel(net.heartsome.cat.common.ui.HsImageLabel) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) HsImageLabel(net.heartsome.cat.common.ui.HsImageLabel) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Link(org.eclipse.swt.widgets.Link)

Aggregations

Link (org.eclipse.swt.widgets.Link)197 SelectionEvent (org.eclipse.swt.events.SelectionEvent)136 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)130 GridData (org.eclipse.swt.layout.GridData)120 Composite (org.eclipse.swt.widgets.Composite)114 Label (org.eclipse.swt.widgets.Label)110 GridLayout (org.eclipse.swt.layout.GridLayout)77 Button (org.eclipse.swt.widgets.Button)71 Text (org.eclipse.swt.widgets.Text)40 SelectionListener (org.eclipse.swt.events.SelectionListener)23 Group (org.eclipse.swt.widgets.Group)23 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)19 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)19 Event (org.eclipse.swt.widgets.Event)19 Combo (org.eclipse.swt.widgets.Combo)18 URL (java.net.URL)17 ModifyListener (org.eclipse.swt.events.ModifyListener)16 Listener (org.eclipse.swt.widgets.Listener)16 Shell (org.eclipse.swt.widgets.Shell)15 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)14