Java 类org.eclipse.swt.widgets.Link 实例源码

项目:neoscada    文件:LinkComposite.java   
public LinkComposite ( final Composite parent, final int style, final String format )
{
    super ( parent, style );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.textLabel = new Link ( this, SWT.NONE );
    this.textLabel.setText ( format );

    this.textLabel.addSelectionListener ( new SelectionAdapter () {

        @Override
        public void widgetSelected ( final SelectionEvent event )
        {
            logger.info ( "LinkComponent selected: {}", event.text ); //$NON-NLS-1$
            Program.launch ( event.text );
        }
    } );
}
项目:convertigo-eclipse    文件:ProjectDeploySuccessfulDialog.java   
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);

    Link link = new Link(container, SWT.NONE);
    link.setText("Your project has been successfully deployed.\n\nYou can try it with this URL:\n<a href=\""+ projectURL + "\">" + projectURL + "</a>");
    link.addListener (SWT.Selection, new Listener () {

        public void handleEvent(Event event) {
            org.eclipse.swt.program.Program.launch(event.text);
        }

    });

    link.setSize(330, 150);

    return container;
}
项目:APITools    文件:ShortcutKeyExplain.java   
private void createContents(String str) {
    aboutToolsShell = new Shell(getParent(), getStyle());
    aboutToolsShell.setImage(SWTResourceManager.getImage(ShortcutKeyExplain.class, Resource.IMAGE_ICON));
    aboutToolsShell.setSize(400, 391);
    aboutToolsShell.setText(getText());
    PubUtils.setCenterinParent(getParent(), aboutToolsShell);

    Link link = new Link(aboutToolsShell, SWT.NONE);
    link.setBounds(143, 336, 108, 17);
    link.setText("<a>www.itlaborer.com</a>");
    link.addSelectionListener(new LinkSelection());

    StyledText readMeTextLabel = new StyledText(aboutToolsShell,
            SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
    readMeTextLabel.setBounds(3, 33, 389, 297);
    readMeTextLabel.setText(str);

    Label label_2 = new Label(aboutToolsShell, SWT.NONE);
    label_2.setFont(org.eclipse.wb.swt.SWTResourceManager.getFont("微软雅黑", 9, SWT.BOLD));
    label_2.setText("快捷键说明:");
    label_2.setBounds(3, 12, 136, 17);
}
项目:Hydrograph    文件:ComponentTooltip.java   
private void addSelectionListenerToLink(final PropertyToolTipInformation propertyInfo, final Link link) {
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
        if(OPERATION.equalsIgnoreCase(propertyInfo.getPropertyName()))
         transformMapping.setAddPassThroughFields(true);
        else if(JOIN_MAPPING.equalsIgnoreCase(propertyInfo.getPropertyName()))
        {
            joinMappingGrid.setAddPassThroughFields(true);
        }
        else if(LOOKUP_MAPPING.equalsIgnoreCase(propertyInfo.getPropertyName()))
        {
            lookupMappingGrid.setAddPassThroughFields(true);
        }   
            link.setLinkForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0,0,255));
        }
    });
}
项目:Hydrograph    文件:ComponentTooltip.java   
/**
 * Add listener to open operation class file
 * 
 * @param filePath
 * @param link
 */
private void addListenerToOpenOpeartionClassFile(final String filePath,
        Link link) {
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            logger.debug("ComponentTooltip.widgetSelected(): Link clicked");
            super.widgetSelected(e);
            boolean flag = FilterOperationClassUtility.INSTANCE.openFileEditor(null,filePath);
            if (!flag) {
                logger.debug("ComponentTooltip.widgetSelected(): Link clicked - error - File " + filePath + " Not Found");
                WidgetUtility.errorMessage("File Not Found"); 
            } else {
                logger.debug("ComponentTooltip.widgetSelected(): Link clicked - hiding tooltip");
                setVisible(false);
            }
        }
    });

    logger.debug("ComponentTooltip.addListenerToOpenOpeartionClassFile(): added opeartion class link listener");
}
项目:egradle    文件:EGradlePreferencePage.java   
/**
 * Creates the field editors. Field editors are abstractions of the common
 * GUI blocks needed to manipulate various types of preferences. Each field
 * editor knows how to save and restore itself.
 */
public void createFieldEditors() {

    Composite composite = getFieldEditorParent();

    String message = "You can visit the project site at <a href=\"https://github.com/de-jcup/egradle/wiki\">GitHub</a>.";

    Link link = new Link(composite, SWT.NONE);
    link.setText(message);
    link.setSize(400, 100);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                // Open default external browser
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(e.text));
            } catch (Exception ex) {
                MainActivator.getDefault().getLog().log(new Status(IStatus.ERROR, MainActivator.PLUGIN_ID, "Was not able to open url in external browser", ex));
            }
        }
    });


}
项目:google-cloud-eclipse    文件:FlexDeployPreferencesDialog.java   
@Override
protected Control createDialogArea(final Composite parent) {
  Composite dialogArea = (Composite) super.createDialogArea(parent);

  Composite container = new Composite(dialogArea, SWT.NONE);
  Link flexPricing = new Link(container, SWT.WRAP);
  flexPricing.setText(Messages.getString("deploy.preferences.dialog.flex.pricing")); //$NON-NLS-1$
  flexPricing.addSelectionListener(
      new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
  FontUtil.convertFontToItalic(flexPricing);

  GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
  Point margins = LayoutConstants.getMargins();
  GridLayoutFactory.fillDefaults()
      .extendedMargins(margins.x, margins.x, 0 /* no upper margin */, margins.y)
      .generateLayout(container);

  return dialogArea;
}
项目:google-cloud-eclipse    文件:ProjectSelector.java   
public ProjectSelector(Composite parent) {
  super(parent, SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(2).spacing(0, 0).applyTo(this);

  Composite tableComposite = new Composite(this, SWT.NONE);
  TableColumnLayout tableColumnLayout = new TableColumnLayout();
  tableComposite.setLayout(tableColumnLayout);
  GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
  viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
  createColumns(tableColumnLayout);
  viewer.getTable().setHeaderVisible(true);
  viewer.getTable().setLinesVisible(false);

  input = WritableList.withElementType(GcpProject.class);
  projectProperties = PojoProperties.values(new String[] {"name", "id"}); //$NON-NLS-1$ //$NON-NLS-2$
  ViewerSupport.bind(viewer, input, projectProperties);
  viewer.setComparator(new ViewerComparator());

  Composite linkComposite = new Composite(this, SWT.NONE);
  statusLink = new Link(linkComposite, SWT.WRAP);
  statusLink.addSelectionListener(
      new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
  statusLink.setText("");
  GridDataFactory.fillDefaults().span(2, 1).applyTo(linkComposite);
  GridLayoutFactory.fillDefaults().generateLayout(linkComposite);
}
项目:TuxGuitar-1.3.1-fork    文件:TGCommunityStartupScreen.java   
private void addComment( Composite parent , String text ){
    final Link link = new Link( parent , SWT.LEFT );
    link.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
    link.setText(text);
    link.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event event) {
            final String href = event.text;
            if( href != null ){
                new Thread( new Runnable() {
                    public void run() throws TGException {
                        TGCommunityWeb.open(getContext(), href);
                    }
                } ).start();
            }
        }
    });
}
项目:typescript.java    文件:PropertyAndPreferencePage.java   
final void doLinkActivated(Link link) {
    Map data = new HashMap();
    data.put(DATA_NO_LINK, Boolean.TRUE);

    if (isProjectPreferencePage()) {
        openWorkspacePreferences(data);
    } else {
        /*
         * HashSet projectsWithSpecifics= new HashSet(); try {
         * IJavaScriptProject[] projects=
         * JavaScriptCore.create(ResourcesPlugin.getWorkspace().getRoot()).
         * getJavaScriptProjects(); for (int i= 0; i < projects.length; i++)
         * { IJavaScriptProject curr= projects[i]; if
         * (hasProjectSpecificOptions(curr.getProject())) {
         * projectsWithSpecifics.add(curr); } } } catch
         * (JavaScriptModelException e) { // ignore } ProjectSelectionDialog
         * dialog= new ProjectSelectionDialog(getShell(),
         * projectsWithSpecifics); if (dialog.open() == Window.OK) {
         * IJavaScriptProject res= (IJavaScriptProject)
         * dialog.getFirstResult(); openProjectProperties(res.getProject(),
         * data); }
         */
    }
}
项目:statecharts    文件:MessageArea.java   
protected void createControls() {
    group = new Group(this, SWT.NONE);
    group.setLayout(new GridLayout(3, false));
    imageLabel = new Label(group, SWT.NONE);
    GridDataFactory.fillDefaults().grab(false, false).align(SWT.BEGINNING, SWT.CENTER).applyTo(imageLabel);
    textLabel = new Link(group, SWT.WRAP);
    textLabel.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (DOWNLOAD_LINK.equals(e.text)) {
                Program.launch(DOWNLOAD_LINK);
            } else {
                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(), PREF_PAGE_ID,
                        new String[] { DISPLAY_ID }, null);
                dialog.setSelectedNode("DISPLAY_ID");
                dialog.open();
            }
        }
    });
    GridDataFactory.fillDefaults().grab(true, false).align(SWT.CENTER, SWT.CENTER).applyTo(textLabel);
    button = new Button(group, SWT.FLAT);
    button.setText("Download");
    GridDataFactory.fillDefaults().grab(false, false).align(SWT.END, SWT.CENTER).applyTo(button);
}
项目:git-appraise-eclipse    文件:CommitAttributeEditor.java   
@Override
public void createControl(final Composite parent, FormToolkit toolkit) {
  link = new Link(parent, SWT.BORDER);
  link.setText("<a>" + getValue() + "</a>");
  link.addListener(SWT.Selection, new Listener() {
    @Override
    public void handleEvent(Event event) {
      try {
        RepositoryCommit commit = getCommit();
        if (commit != null) {
          CommitEditor.openQuiet(commit);
        } else {
          MessageDialog alert = new MessageDialog(parent.getShell(), "Oops", null,
              "Commit " + getValue() + " not found", MessageDialog.ERROR, new String[] {"OK"}, 0);
          alert.open();
        }
      } catch (IOException e) {
        AppraiseUiPlugin.logError("Error reading commit " + getValue(), e);
      }
    }
  });
  setControl(link);
}
项目:APICloud-Studio    文件:HyperlinkMessageDialog.java   
@Override
protected Control createMessageArea(Composite composite)
{
    String message = this.message;
    this.message = null;
    Composite messageArea = (Composite) super.createMessageArea(composite);
    messageLink = new Link(messageArea, getMessageLabelStyle() | SWT.NO_FOCUS);
    messageLink.setText("<a></a>" + message); //$NON-NLS-1$
    GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).grab(true, false)
            .hint(convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH), SWT.DEFAULT)
            .applyTo(messageLink);
    messageLink.addSelectionListener(new SelectionAdapter()
    {
        public void widgetSelected(SelectionEvent e)
        {
            openLink(e);
        }
    });
    return messageArea;
}
项目:mytourbook    文件:SlideoutTourFilter.java   
private int createUI_Field_Text(final Composite parent) {

        {
            /*
             * Link: Fulltext search hint
             */
            final Link link = new Link(parent, SWT.NONE);
            link.setText(Messages.Slideout_TourFilter_Link_TextSearchHint);
            link.setToolTipText(Messages.Slideout_TourFilter_Link_TextSearchHint_Tooltip);
            link.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    Util.showView(SearchView.ID, true);
                }
            });
        }

        return 1;
    }
项目:mytourbook    文件:DialogEasyImportConfig.java   
private void createUI_270_IC_3_99_Actions(final Composite parent) {

        // V-spacer
        new Label(parent, SWT.NONE);

        {
            _linkIC_ILActions = new Link(parent, SWT.NONE);
            _linkIC_ILActions.setText(Messages.Dialog_ImportConfig_Link_OtherActions);
            _linkIC_ILActions.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelect_IC_LauncherActions();
                }
            });
            GridDataFactory
                    .fillDefaults()//
                    .grab(true, false)
                    .span(2, 1)
                    .align(SWT.FILL, SWT.CENTER)
                    .applyTo(_linkIC_ILActions);
        }

        // V-spacer
        new Label(parent, SWT.NONE);
    }
项目:mytourbook    文件:DialogEasyImportConfig.java   
private void onSpeed_IL_TT_SetTourType(final int speedTTIndex, final TourType tourType) {

        /*
         * Update UI
         */
        final Image image = TourTypeImage.getTourTypeImage(tourType.getTypeId());
        final Label ttIcon = _lblTT_Speed_TourTypeIcon[speedTTIndex];
        final Link ttLink = _linkTT_Speed_TourType[speedTTIndex];

        ttIcon.setImage(image);

        ttLink.setText(UI.LINK_TAG_START + tourType.getName() + UI.LINK_TAG_END);
        ttLink.setData(DATA_KEY_TOUR_TYPE_ID, tourType.getTypeId());

        _speedTourType_OuterContainer.layout();

        // update UI with modified tour type
        update_Model_From_UI_IL();
        _ilViewer.update(_selectedIL, null);

        redrawILViewer();
    }
项目:mytourbook    文件:SearchView.java   
private void createUI_20_SearchExternal(final Composite parent) {

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
        GridLayoutFactory.swtDefaults().numColumns(1).applyTo(container);
        {
            final Link linkExternalBrowser = new Link(container, SWT.WRAP | SWT.READ_ONLY);
            GridDataFactory.fillDefaults()//
                    .grab(true, true)
                    .applyTo(linkExternalBrowser);

            linkExternalBrowser.setText(NLS.bind(
                    Messages.Search_View_Link_ExternalBrowser,
                    SearchMgr.SEARCH_URL,
                    SearchMgr.SEARCH_URL));

            linkExternalBrowser.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    WEB.openUrl(SearchMgr.SEARCH_URL);
                }
            });

            createUI_50_SetupExternalWebbrowser(parent, container);
        }
    }
项目:mytourbook    文件:SearchView.java   
private void createUI_50_SetupExternalWebbrowser(final Composite parent, final Composite container) {

        /*
         * Link: Setup browser
         */
        final Link linkSetupBrowser = new Link(container, SWT.WRAP);
        GridDataFactory.fillDefaults()//
                .align(SWT.FILL, SWT.END)
                .applyTo(linkSetupBrowser);

        linkSetupBrowser.setText(Messages.Search_View_Link_SetupExternalBrowser);
        linkSetupBrowser.setEnabled(true);
        linkSetupBrowser.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                PreferencesUtil.createPreferenceDialogOn(//
                        parent.getShell(),
                        PrefPageWebBrowser.ID,
                        null,
                        null).open();
            }
        });
    }
项目:areca-backup-release-mirror    文件:TargetTreeComposite.java   
private void setBackupWorkspace() {
    if (warning == null) {
        warning = new Label(this, SWT.WRAP);
        warning.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 2, 1));
        warning.setText(ResourceManager.instance().getLabel("targettree.isbackup.warning"));
        warning.setForeground(Colors.C_RED);


        more = new Link(this, SWT.NONE);
        more.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 2, 1));
        more.setText("<A HREF=\"" + ArecaURLs.BACKUP_COPY_URL + "\">" + ResourceManager.instance().getLabel("targettree.isbackup.more") + "</A>");
        more.addListener (SWT.Selection, new Listener () {
            public void handleEvent(Event event) {
                try {
                    ViewerHandlerHelper.getViewerHandler().browse(new URL(event.text));
                } catch (Exception e) {
                    Logger.defaultLogger().error(e);
                }
            }
        });

        this.layout(true);
    }
}
项目:areca-backup-release-mirror    文件:DonationWindow.java   
protected Control createContents(Composite parent) {
      Composite composite = new Composite(parent, SWT.NONE);
      composite.setLayout(new GridLayout(2, false));

Label icon = new Label(composite, SWT.NONE);
icon.setImage(ArecaImages.ICO_BIG);
icon.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 2));

      Label lbl = new Label(composite, SWT.NONE);
      lbl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
      lbl.setText("You have used Areca-Backup more than " + ArecaUserPreferences.getLaunchCount() + " times since its installation on your computer.\nIf you find Areca useful, please consider making a donation to support the time that has been (and still is) spent on it.");

      Link lnk = DonationLink.build(composite);
      lnk.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));

      SavePanel pnlSave = new SavePanel(RM.getLabel("common.close.label"), this);
      pnlSave.setShowCancel(false);
      Composite pnl = pnlSave.buildComposite(composite);
      pnl.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 2, 1));

      composite.pack();
      return composite;
  }
项目:areca-backup-release-mirror    文件:AboutWindow.java   
private Text configurePanel(Composite composite, int style) {
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);

    GridData dt = new GridData();
    dt.grabExcessHorizontalSpace = true;
    dt.grabExcessVerticalSpace = true;
    dt.verticalAlignment = SWT.FILL;
    dt.horizontalAlignment = SWT.FILL;
    dt.heightHint = heightHint;
    dt.widthHint = widthHint;

    Text content = new Text(composite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER | style);
    content.setEditable(false);
    content.setLayoutData(dt);

    Link lnk = DonationLink.build(composite);
    lnk.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));

    return content;
}
项目:Eclipse-Postfix-Code-Completion    文件:AddDelegateMethodsAction.java   
@Override
protected Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP);
    link.setText(ActionMessages.AddDelegateMethodsAction_template_link_message);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openCodeTempatePage(CodeTemplateContextType.OVERRIDECOMMENT_ID);
        }
    });
    link.setToolTipText(ActionMessages.AddDelegateMethodsAction_template_link_tooltip);

    GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
    link.setLayoutData(gridData);
    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:AddGetterSetterAction.java   
@Override
protected Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP);
    link.setText(ActionMessages.AddGetterSetterAction_template_link_description);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openCodeTempatePage(CodeTemplateContextType.GETTERCOMMENT_ID);
        }
    });
    link.setToolTipText(ActionMessages.AddGetterSetterAction_template_link_tooltip);

    GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
    link.setLayoutData(gridData);
    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:AddUnimplementedConstructorsAction.java   
@Override
protected Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP);
    link.setText(ActionMessages.AddUnimplementedConstructorsAction_template_link_message);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openCodeTempatePage(CodeTemplateContextType.CONSTRUCTORCOMMENT_ID);
        }
    });
    link.setToolTipText(ActionMessages.AddUnimplementedConstructorsAction_template_link_tooltip);

    GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
    link.setLayoutData(gridData);
    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:NewJavaProjectWizardPageOne.java   
public Control createContent(Composite composite) {
    fGroup= new Group(composite, SWT.NONE);
    fGroup.setFont(composite.getFont());
    fGroup.setLayout(initGridLayout(new GridLayout(3, false), true));
    fGroup.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_title);

    fStdRadio.doFillIntoGrid(fGroup, 3);
    LayoutUtil.setHorizontalGrabbing(fStdRadio.getSelectionButton(null));

    fSrcBinRadio.doFillIntoGrid(fGroup, 2);

    fPreferenceLink= new Link(fGroup, SWT.NONE);
    fPreferenceLink.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_link_description);
    fPreferenceLink.setLayoutData(new GridData(GridData.END, GridData.END, false, false));
    fPreferenceLink.addSelectionListener(this);

    updateEnableState();
    return fGroup;
}
项目:Eclipse-Postfix-Code-Completion    文件:NewJavaProjectWizardPageOne.java   
public Control createControl(Composite composite) {
    fGroup= new Group(composite, SWT.NONE);
    fGroup.setFont(composite.getFont());
    fGroup.setLayout(initGridLayout(new GridLayout(2, false), true));
    fGroup.setText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_title);

    fUseEEJRE.doFillIntoGrid(fGroup, 1);
    Combo eeComboControl= fEECombo.getComboControl(fGroup);
    eeComboControl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    fUseProjectJRE.doFillIntoGrid(fGroup, 1);
    Combo comboControl= fJRECombo.getComboControl(fGroup);
    comboControl.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

    fUseDefaultJRE.doFillIntoGrid(fGroup, 1);

    fPreferenceLink= new Link(fGroup, SWT.NONE);
    fPreferenceLink.setFont(fGroup.getFont());
    fPreferenceLink.setText(NewWizardMessages.NewJavaProjectWizardPageOne_JREGroup_link_description);
    fPreferenceLink.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
    fPreferenceLink.addSelectionListener(this);

    updateEnableState();
    return fGroup;
}
项目:Eclipse-Postfix-Code-Completion    文件:NewJavaProjectWizardPageOne.java   
public Control createControl(Composite parent) {

            Composite composite= new Composite(parent, SWT.NONE);
            composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
            GridLayout layout= new GridLayout(2, false);
            layout.horizontalSpacing= 10;
            composite.setLayout(layout);

            fIcon= new Label(composite, SWT.LEFT);
            fIcon.setImage(Dialog.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));
            GridData gridData= new GridData(SWT.LEFT, SWT.TOP, false, false);
            fIcon.setLayoutData(gridData);

            fHintText= new Link(composite, SWT.WRAP);
            fHintText.setFont(composite.getFont());
            fHintText.addSelectionListener(this);
            gridData= new GridData(GridData.FILL, SWT.FILL, true, true);
            gridData.widthHint= convertWidthInCharsToPixels(50);
            gridData.heightHint= convertHeightInCharsToPixels(3);
            fHintText.setLayoutData(gridData);

            handlePossibleJVMChange();
            return composite;
        }
项目:Eclipse-Postfix-Code-Completion    文件:GenerateConstructorUsingFieldsSelectionDialog.java   
@Override
protected Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP);
    link.setText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_template_link_message);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openCodeTempatePage(CodeTemplateContextType.CONSTRUCTORCOMMENT_ID);
        }
    });
    link.setToolTipText(ActionMessages.GenerateConstructorUsingFieldsSelectionDialog_template_link_tooltip);

    GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
    link.setLayoutData(gridData);
    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:OverrideMethodDialog.java   
@Override
protected Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP);
    link.setText(JavaUIMessages.OverrideMethodDialog_link_message);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openCodeTempatePage(CodeTemplateContextType.OVERRIDECOMMENT_ID);
        }
    });
    link.setToolTipText(JavaUIMessages.OverrideMethodDialog_link_tooltip);

    GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    gridData.widthHint= convertWidthInCharsToPixels(40); // only expand further if anyone else requires it
    link.setLayoutData(gridData);
    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:SortMembersMessageDialog.java   
private Control createLinkControl(Composite composite) {
    Link link= new Link(composite, SWT.WRAP | SWT.RIGHT);
    link.setText(DialogsMessages.SortMembersMessageDialog_description);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            openMembersSortOrderPage();
        }
    });
    link.setToolTipText(DialogsMessages.SortMembersMessageDialog_link_tooltip);
    GridData gridData= new GridData(GridData.FILL, GridData.CENTER, true, false);
    gridData.widthHint= convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);//convertWidthInCharsToPixels(60);
    link.setLayoutData(gridData);
    link.setFont(composite.getFont());

    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:PropertiesFileEditorPreferencePage.java   
private void createHeader(Composite contents) {
    String text= PreferencesMessages.PropertiesFileEditorPreferencePage_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(getShell(), e.text, null, null);
            else if ("org.eclipse.ui.preferencePages.ColorsAndFonts".equals(e.text)) //$NON-NLS-1$
                PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, "selectFont:org.eclipse.jdt.ui.PropertiesFileEditor.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);
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditorAppearanceConfigurationBlock.java   
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);
}
项目:read-open-source-code    文件:TeraFastAboutDialog.java   
/**
 * 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);
        }
    });
}
项目:Eclipse-Postfix-Code-Completion    文件:CodeAssistAdvancedConfigurationBlock.java   
private void createKeysLink(Composite composite, int h_span) {
   Link link= new Link(composite, SWT.NONE | SWT.WRAP);
link.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_key_binding_hint);
link.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
        PreferencesUtil.createPreferenceDialogOn(getShell(), e.text, null, null);
    }
});

PixelConverter pixelConverter= new PixelConverter(composite);
int width= pixelConverter.convertWidthInCharsToPixels(40);

// limit the size of the Link as it would take all it can get
GridData gd= new GridData(GridData.FILL, GridData.FILL, false, false, h_span, 1);
gd.widthHint= width;
link.setLayoutData(gd);
  }
项目:Eclipse-Postfix-Code-Completion    文件:OptionsConfigurationBlock.java   
protected Link addLink(Composite parent, String label, Key key, SelectionListener linkListener, int indent, int widthHint) {
    GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan= 3;
    gd.horizontalIndent= indent;
    gd.widthHint= widthHint;

    Link link= new Link(parent, SWT.NONE);
    link.setFont(JFaceResources.getDialogFont());
    link.setText(label);
    link.setData(key);
    link.setLayoutData(gd);
    link.addSelectionListener(linkListener);

    makeScrollableCompositeAware(link);

    fLinks.add(link);

    return link;
}
项目:Eclipse-Postfix-Code-Completion    文件:OptionsConfigurationBlock.java   
protected Link createIgnoreOptionalProblemsLink(Composite parent) {
    final IClasspathEntry sourceFolderEntry= getSourceFolderIgnoringOptionalProblems();
    if (sourceFolderEntry != null) {
        Link link= new Link(parent, SWT.NONE);
        link.setText(PreferencesMessages.OptionsConfigurationBlock_IgnoreOptionalProblemsLink);
        link.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                HashMap<Object, Object> data= new HashMap<Object, Object>(1);
                data.put(BuildPathsPropertyPage.DATA_REVEAL_ENTRY, sourceFolderEntry);
                data.put(BuildPathsPropertyPage.DATA_REVEAL_ATTRIBUTE_KEY, IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS);
                getPreferenceContainer().openPage(BuildPathsPropertyPage.PROP_ID, data);
            }
        });
        return link;
    }
    return null;
}
项目:read-open-source-code    文件:OlapInputAboutDialog.java   
/**
 * 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);
        }
    });
}
项目:Eclipse-Postfix-Code-Completion    文件:OptionsConfigurationBlock.java   
protected Control findControl(Key key) {
    Combo comboBox= getComboBox(key);
    if (comboBox != null) {
        return comboBox;
    }
    Button checkBox= getCheckBox(key);
    if (checkBox != null) {
        return checkBox;
    }
    Text text= getTextControl(key);
    if (text != null) {
        return text;
    }
    Link link= getLink(key);
    if (link != null) {
        return link;
    }
    return null;
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaEditorPropertyPage.java   
@Override
protected Control createContents(Composite parent) {
    final Composite composite= new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    composite.setLayout(new GridLayout());

    Link link= new Link(composite, SWT.WRAP);
    GridData data= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
    data.widthHint= 300;
    link.setLayoutData(data);
    link.setText(PreferencesMessages.JavaEditorPropertyPage_SaveActionLink_Text);
    link.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer)getContainer();
            container.openPage(SaveParticipantPreferencePage.PROPERTY_PAGE_ID, null);
        }
    });
    noDefaultAndApplyButton();
    Dialog.applyDialogFont(composite);
    return composite;
}
项目:Eclipse-Postfix-Code-Completion    文件:ComplianceConfigurationBlock.java   
private void updateComplianceFollowsEE() {
    if (fProject != null) {
        String complianceFollowsEE= DISABLED;
        IExecutionEnvironment ee= getEE();
        String label;
        if (ee != null) {
            complianceFollowsEE= getComplianceFollowsEE(ee);
            label= Messages.format(PreferencesMessages.ComplianceConfigurationBlock_compliance_follows_EE_with_EE_label, ee.getId());
        } else {
            label= PreferencesMessages.ComplianceConfigurationBlock_compliance_follows_EE_label;
        }
        Link checkBoxLink= getCheckBoxLink(INTR_COMPLIANCE_FOLLOWS_EE);
        if (checkBoxLink != null) {
            checkBoxLink.setText(label);
        }
        setValue(INTR_COMPLIANCE_FOLLOWS_EE, complianceFollowsEE);
    }
}