java类org.eclipse.swt.widgets.Link的实例源码

LinkComposite.java 文件源码 项目:neoscada 阅读 25 收藏 0 点赞 0 评论 0
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 );
        }
    } );
}
ProjectDeploySuccessfulDialog.java 文件源码 项目:convertigo-eclipse 阅读 27 收藏 0 点赞 0 评论 0
/**
 * 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;
}
ShortcutKeyExplain.java 文件源码 项目:APITools 阅读 31 收藏 0 点赞 0 评论 0
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);
}
ComponentTooltip.java 文件源码 项目:Hydrograph 阅读 25 收藏 0 点赞 0 评论 0
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));
        }
    });
}
ComponentTooltip.java 文件源码 项目:Hydrograph 阅读 28 收藏 0 点赞 0 评论 0
/**
 * 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");
}
EGradlePreferencePage.java 文件源码 项目:egradle 阅读 20 收藏 0 点赞 0 评论 0
/**
 * 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));
            }
        }
    });


}
FlexDeployPreferencesDialog.java 文件源码 项目:google-cloud-eclipse 阅读 22 收藏 0 点赞 0 评论 0
@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;
}
ProjectSelector.java 文件源码 项目:google-cloud-eclipse 阅读 22 收藏 0 点赞 0 评论 0
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);
}
TGCommunityStartupScreen.java 文件源码 项目:TuxGuitar-1.3.1-fork 阅读 30 收藏 0 点赞 0 评论 0
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();
            }
        }
    });
}
PropertyAndPreferencePage.java 文件源码 项目:typescript.java 阅读 24 收藏 0 点赞 0 评论 0
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); }
         */
    }
}
MessageArea.java 文件源码 项目:statecharts 阅读 32 收藏 0 点赞 0 评论 0
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);
}
CommitAttributeEditor.java 文件源码 项目:git-appraise-eclipse 阅读 18 收藏 0 点赞 0 评论 0
@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);
}
HyperlinkMessageDialog.java 文件源码 项目:APICloud-Studio 阅读 27 收藏 0 点赞 0 评论 0
@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;
}
SlideoutTourFilter.java 文件源码 项目:mytourbook 阅读 30 收藏 0 点赞 0 评论 0
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;
    }
DialogEasyImportConfig.java 文件源码 项目:mytourbook 阅读 31 收藏 0 点赞 0 评论 0
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);
    }
DialogEasyImportConfig.java 文件源码 项目:mytourbook 阅读 26 收藏 0 点赞 0 评论 0
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();
    }
SearchView.java 文件源码 项目:mytourbook 阅读 42 收藏 0 点赞 0 评论 0
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);
        }
    }
SearchView.java 文件源码 项目:mytourbook 阅读 33 收藏 0 点赞 0 评论 0
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();
            }
        });
    }
TargetTreeComposite.java 文件源码 项目:areca-backup-release-mirror 阅读 19 收藏 0 点赞 0 评论 0
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);
    }
}
DonationWindow.java 文件源码 项目:areca-backup-release-mirror 阅读 25 收藏 0 点赞 0 评论 0
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;
  }
AboutWindow.java 文件源码 项目:areca-backup-release-mirror 阅读 31 收藏 0 点赞 0 评论 0
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;
}
AddDelegateMethodsAction.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 25 收藏 0 点赞 0 评论 0
@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;
}
AddGetterSetterAction.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 26 收藏 0 点赞 0 评论 0
@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;
}
AddUnimplementedConstructorsAction.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 29 收藏 0 点赞 0 评论 0
@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;
}
NewJavaProjectWizardPageOne.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 38 收藏 0 点赞 0 评论 0
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;
}
NewJavaProjectWizardPageOne.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 36 收藏 0 点赞 0 评论 0
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;
}
NewJavaProjectWizardPageOne.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 29 收藏 0 点赞 0 评论 0
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;
        }
GenerateConstructorUsingFieldsSelectionDialog.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 23 收藏 0 点赞 0 评论 0
@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;
}
OverrideMethodDialog.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 30 收藏 0 点赞 0 评论 0
@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;
}
SortMembersMessageDialog.java 文件源码 项目:Eclipse-Postfix-Code-Completion 阅读 26 收藏 0 点赞 0 评论 0
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;
}


问题


面经


文章

微信
公众号

扫码关注公众号