Java 类org.eclipse.ui.forms.events.HyperlinkAdapter 实例源码

项目:neoscada    文件:ConfigurationFormToolkit.java   
public void createStandardLinkText ( final Composite parent, final String linkFactory, final String attributeName, final String label, final String textMessage, final ConfigurationEditorInput input, final Object valueType )
{
    this.toolkit.createLabel ( parent, label + ":" );

    final Text text = this.toolkit.createText ( parent, "" );
    text.setMessage ( textMessage );
    text.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, true ) );
    text.setToolTipText ( textMessage );

    final IObservableValue value = Observables.observeMapEntry ( input.getDataMap (), attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );

    final Hyperlink link = this.toolkit.createHyperlink ( parent, "link", SWT.NONE );
    link.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, false, false ) );

    link.addHyperlinkListener ( new HyperlinkAdapter () {

        @Override
        public void linkActivated ( final HyperlinkEvent e )
        {
            EditorHelper.handleOpen ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getActivePage (), input.getConnectionUri (), linkFactory, text.getText () );
        }
    } );
}
项目:team-explorer-everywhere    文件:PageHelpers.java   
public static ImageHyperlink createDropHyperlink(
    final FormToolkit toolkit,
    final Composite parent,
    final String text,
    final Menu menu) {
    final ImageHyperlink link = createDropHyperlink(toolkit, parent, text);

    link.setMenu(menu);
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            PageHelpers.showPopup(link);
        }
    });

    final Point point = link.getLocation();
    point.y += link.getSize().y;
    link.getMenu().setLocation(point);
    link.getMenu().setVisible(false);

    return link;
}
项目:subclipse    文件:CloudForgeComposite.java   
private void createControls() { 
    Composite cloudForgeComposite = new Composite(this, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    cloudForgeComposite.setLayout(layout);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    cloudForgeComposite.setLayoutData(data);

    ImageHyperlink cloudForgeLink = new ImageHyperlink(cloudForgeComposite, SWT.NONE);
    cloudForgeLink.setImage(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_CLOUDFORGE).createImage());
    cloudForgeLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent evt) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(SIGNUP_URL));
            } catch (Exception e) {
                MessageDialog.openError(getShell(), "Sign-up for CloudForge", e.getMessage());
            }
        }           
    });
    cloudForgeLink.setToolTipText(SIGNUP_URL);
}
项目:APICloud-Studio    文件:CloudForgeComposite.java   
private void createControls() { 
    Composite cloudForgeComposite = new Composite(this, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    cloudForgeComposite.setLayout(layout);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    cloudForgeComposite.setLayoutData(data);

    ImageHyperlink cloudForgeLink = new ImageHyperlink(cloudForgeComposite, SWT.NONE);
    cloudForgeLink.setImage(SVNUIPlugin.getPlugin().getImageDescriptor(ISVNUIConstants.IMG_CLOUDFORGE).createImage());
    cloudForgeLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent evt) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(SIGNUP_URL));
            } catch (Exception e) {
                MessageDialog.openError(getShell(), "Sign-up for CloudForge", e.getMessage());
            }
        }           
    });
    cloudForgeLink.setToolTipText(SIGNUP_URL);
}
项目:Eclipse-Postfix-Code-Completion    文件:HintTextGroup.java   
/**
  * Create a label with a hyperlink and a picture.
  *
  * @param parent the parent widget of the label
  * @param text the text of the label
  * @param action the action to be executed if the hyperlink is activated
  */
 private void createLabel(Composite parent, String text, final BuildpathModifierAction action) {
     FormText formText= createFormText(parent, text);
     Image image= fImageMap.get(action.getId());
     if (image == null) {
         image= action.getImageDescriptor().createImage();
         fImageMap.put(action.getId(), image);
     }
     formText.setImage("defaultImage", image); //$NON-NLS-1$
     formText.addHyperlinkListener(new HyperlinkAdapter() {

         @Override
public void linkActivated(HyperlinkEvent e) {
             action.run();
         }

     });
 }
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:HintTextGroup.java   
/**
  * Create a label with a hyperlink and a picture.
  *
  * @param parent the parent widget of the label
  * @param text the text of the label
  * @param action the action to be executed if the hyperlink is activated
  */
 private void createLabel(Composite parent, String text, final BuildpathModifierAction action) {
     FormText formText= createFormText(parent, text);
     Image image= fImageMap.get(action.getId());
     if (image == null) {
         image= action.getImageDescriptor().createImage();
         fImageMap.put(action.getId(), image);
     }
     formText.setImage("defaultImage", image); //$NON-NLS-1$
     formText.addHyperlinkListener(new HyperlinkAdapter() {

         @Override
public void linkActivated(HyperlinkEvent e) {
             action.run();
         }

     });
 }
项目:ant-ivyde    文件:ResolveVisualizerForm.java   
private void configureFormText(final Form form, FormText text) {
    text.addHyperlinkListener(new HyperlinkAdapter() {
        @SuppressWarnings("unchecked")
        public void linkActivated(HyperlinkEvent e) {
            String is = (String) e.getHref();
            try {
                ((FormText) e.widget).getShell().dispose();
                int index = Integer.parseInt(is);
                IMessage[] messages = form.getChildrenMessages();
                IMessage message = messages[index];
                Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) message.getData();
                if (conflicts != null) {
                    viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
                }
            } catch (NumberFormatException ex) {
            }
        }
    });
    text.setImage("error", getImage(IMessageProvider.ERROR));
    text.setImage("warning", getImage(IMessageProvider.WARNING));
    text.setImage("info", getImage(IMessageProvider.INFORMATION));
}
项目:elexis-3-core    文件:DefaultControlFieldProvider.java   
private void populateInnerComposite(){
    for (String l : fields) {
        Hyperlink hl = tk.createHyperlink(inner, l, SWT.NONE);
        hl.addHyperlinkListener(new HyperlinkAdapter() {

            @Override
            public void linkActivated(final HyperlinkEvent e){
                Hyperlink h = (Hyperlink) e.getSource();
                fireSortEvent(h.getText());
            }

        });
        hl.setBackground(inner.getBackground());
    }

    createSelectors(fields.length);
    for (int i = 0; i < selectors.length; i++) {
        selectors[i] = new ElexisText(tk.createText(inner, "", SWT.BORDER)); //$NON-NLS-1$
        selectors[i].addModifyListener(ml);
        selectors[i].addSelectionListener(sl);
        selectors[i].setToolTipText(Messages.DefaultControlFieldProvider_enterFilter); //$NON-NLS-1$
        selectors[i].setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
        SWTHelper.setSelectOnFocus((Text) selectors[i].getWidget());
    }
}
项目:elexis-3-base    文件:RowDisplay.java   
RowDisplay(final Overview parent, final Composite c) {
    super(c, SWT.NONE);
    this.parent = parent;
    setLayout(new FillLayout());
    sash = new SashForm(this, SWT.HORIZONTAL);
    left = new Composite(sash, SWT.NONE);
    left.setLayout(new GridLayout(1, false));
    SWTHelper.createHyperlink(left, Messages.RowDisplay_overview,
            new HyperlinkAdapter() {

                @Override
                public void linkActivated(final HyperlinkEvent e) {
                    parent.setTopControl(parent.dispAll);
                }

            });
    right = new ScrolledComposite(sash, SWT.BORDER | SWT.V_SCROLL
            | SWT.H_SCROLL);
    right.setAlwaysShowScrollBars(true);
    actSlot = 0;
    rightContents = new DetailDisplay(right, parent);
    right.setContent(rightContents);
    sash.setWeights(new int[] { 20, 80 });
}
项目:elexis-3-base    文件:ColumnHeader.java   
public ColumnHeader(Composite parent, AgendaWeek aw){
    super(parent, SWT.NONE);
    view = aw;
    if (UiDesk.getImage(IMG_PERSONS_NAME) == null) {
        UiDesk.getImageRegistry().put(IMG_PERSONS_NAME,
            Activator.getImageDescriptor(IMG_PERSONS_PATH));
    }
    ihRes = new ImageHyperlink(this, SWT.NONE);
    ihRes.setImage(UiDesk.getImage(IMG_PERSONS_NAME));
    ihRes.setToolTipText(Messages.ColumnHeader_selectDaysToDisplay);
    ihRes.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e){
            new SelectDaysDlg().open();
        }

    });
}
项目:elexis-3-base    文件:ColumnHeader.java   
ColumnHeader(Composite parent, AgendaParallel v){
    super(parent, SWT.NONE);
    view = v;

    if (UiDesk.getImage(IMG_PERSONS_NAME) == null) {
        UiDesk.getImageRegistry().put(IMG_PERSONS_NAME,
            Activator.getImageDescriptor(IMG_PERSONS_PATH));
    }
    ihRes = new ImageHyperlink(this, SWT.NONE);
    ihRes.setImage(UiDesk.getImage(IMG_PERSONS_NAME));
    ihRes.setToolTipText(Messages.ColumnHeader_selectMandatorToShow);
    ihRes.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e){
            new SelectResourceDlg().open();
        }

    });

}
项目:eZooKeeper    文件:DataModelFormEditor.java   
protected BaseControlContribution createImageHyperlinkToolBarContribution(String id,
        final DataModel<?, ?, ?> model, final DataModelElementType modelElementType) {

    BaseControlContribution controlContribution = new BaseControlContribution(id) {

        @Override
        protected Control createControlInternal(Composite parent) {
            ImageHyperlink imageHyperlink = new ImageHyperlink(parent, SWT.TOP | SWT.WRAP);
            HyperlinkGroup group = new HyperlinkGroup(imageHyperlink.getDisplay());
            group.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
            group.add(imageHyperlink);

            imageHyperlink.addHyperlinkListener(new HyperlinkAdapter() {

                @Override
                public void linkActivated(HyperlinkEvent e) {
                    BaseOpenAction openAction = modelElementType.getOpenAction();
                    if (openAction != null) {

                        try {
                            openAction.runWithObject(model);
                        }
                        catch (Exception e1) {
                            openAction.reportError(e1);
                        }
                    }
                }
            });

            ElementTypeDataModelImageHyperlinkView view = new ElementTypeDataModelImageHyperlinkView(model,
                    imageHyperlink, modelElementType);
            view.updateView();

            return imageHyperlink;
        }
    };

    return controlContribution;
}
项目:termsuite-ui    文件:FormTextUtil.java   
public static void bindToExternalLink(final FormText formText, final String key, final String webSiteTaggerDocUrl) {
    formText.addHyperlinkListener(new HyperlinkAdapter(){
        @Override
        public void linkActivated(HyperlinkEvent e) {
            if(e.getHref().equals(key)) {
                try {
                    java.awt.Desktop.getDesktop().browse(java.net.URI.create(webSiteTaggerDocUrl));
                } catch (IOException e1) {
                    MessageDialog.openInformation(formText.getShell(), "No browser found", "Could not open the url in your Web browser.");
                }
            }
        }
    });
}
项目:team-explorer-everywhere    文件:TeamExplorerWorkItemPage.java   
@Override
public Composite getPageContent(
    final FormToolkit toolkit,
    final Composite parent,
    final int style,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 3, false, 0, 5);

    // Create the new work item hyper-link
    final String linkText = Messages.getString("TeamExplorerWorkItemPage.NewWorkItemLinkText"); //$NON-NLS-1$
    final Menu menu = createNewWorkItemMenu(composite.getShell(), context);
    final ImageHyperlink link = PageHelpers.createDropHyperlink(toolkit, composite, linkText, menu);

    GridDataBuilder.newInstance().applyTo(link);

    final Label separator = toolkit.createLabel(composite, "|", SWT.VERTICAL); //$NON-NLS-1$
    GridDataBuilder.newInstance().vFill().applyTo(separator);

    // Create the new query hyper-link.
    final String title = Messages.getString("TeamExplorerWorkItemsQueriesSection.NewQueryLinkText"); //$NON-NLS-1$
    final Hyperlink newQueryHyperlink = toolkit.createHyperlink(composite, title, SWT.WRAP);
    newQueryHyperlink.setUnderlined(false);
    newQueryHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            WorkItemHelpers.openNewQuery(context);
        }
    });

    GridDataBuilder.newInstance().applyTo(newQueryHyperlink);

    CodeMarkerDispatch.dispatch(WORKITEMS_PAGE_LOADED);
    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerReportsPage.java   
@Override
public Composite getPageContent(
    final FormToolkit toolkit,
    final Composite parent,
    final int style,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 1, true, 0, 5);

    final Hyperlink link =
        toolkit.createHyperlink(
            composite,
            Messages.getString("TeamExplorerReportsSection.GoToReportsSite"), //$NON-NLS-1$
            SWT.WRAP);

    link.setUnderlined(false);
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            final TFSTeamProjectCollection connection = context.getServer().getConnection();
            final GUID projectGUID = new GUID(context.getCurrentProjectInfo().getGUID());

            final String folderPath = ReportUtils.getProjectReportFolder(connection, projectGUID);
            final String reportManagerUrl = ReportUtils.getReportManagerURL(context.getServer().getConnection());
            final String path = ReportUtils.formatReportManagerPath(reportManagerUrl, folderPath);

            ReportsHelper.openReport(composite.getShell(), path);
        }
    });

    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerPendingChangesPage.java   
private Composite createChangesetStatusComposite(
    final FormToolkit toolkit,
    final Composite parent,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);
    composite.setBackground(parent.getBackground());

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 2, false, 0, 0);

    changesetLink = toolkit.createHyperlink(composite, "link", SWT.NONE); //$NON-NLS-1$
    changesetLink.setUnderlined(true);
    changesetLink.setBackground(parent.getBackground());
    GridDataBuilder.newInstance().applyTo(changesetLink);

    changesetLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            new ViewChangesetDetailsTask(shell, context.getDefaultRepository(), changesetID).run();
        }
    });

    final String labelText = Messages.getString("TeamExplorerPendingChangesPage.SuccessfullyCheckedIn"); //$NON-NLS-1$
    final Label label = toolkit.createLabel(composite, labelText, SWT.NONE);
    label.setBackground(parent.getBackground());
    label.setForeground(parent.getForeground());
    GridDataBuilder.newInstance().hAlignFill().hGrab().applyTo(label);

    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerPendingChangesPage.java   
private Composite createShelvesetStatusComposite(
    final FormToolkit toolkit,
    final Composite parent,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);
    composite.setBackground(parent.getBackground());

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 2, false, 0, 0);

    savedShelvesetLink = toolkit.createHyperlink(composite, "link", SWT.NONE); //$NON-NLS-1$
    savedShelvesetLink.setUnderlined(true);
    savedShelvesetLink.setBackground(parent.getBackground());
    GridDataBuilder.newInstance().applyTo(savedShelvesetLink);

    savedShelvesetLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            PendingChangesHelpers.showShelvesetDetails(shell, context.getDefaultRepository(), savedShelvesetName);
        }
    });

    final String labelText = Messages.getString("TeamExplorerPendingChangesPage.SuccessfullyCreated"); //$NON-NLS-1$
    final Label label = toolkit.createLabel(composite, labelText, SWT.NONE);
    label.setBackground(parent.getBackground());
    label.setForeground(parent.getForeground());
    GridDataBuilder.newInstance().hAlignFill().hGrab().applyTo(label);

    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerPendingChangesPage.java   
private Composite createGatedCheckinComposite(
    final FormToolkit toolkit,
    final Composite parent,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);
    composite.setBackground(parent.getBackground());

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 2, false, 0, 0);

    final String labelText = Messages.getString("TeamExplorerPendingChangesPage.GatedBuildQueuedText"); //$NON-NLS-1$
    final Label label = toolkit.createLabel(composite, labelText, SWT.NONE);
    label.setBackground(parent.getBackground());
    label.setForeground(parent.getForeground());
    GridDataBuilder.newInstance().applyTo(label);

    gatedCheckinLink =
        toolkit.createHyperlink(
            composite,
            Messages.getString("TeamExplorerPendingChangesPage.ViewStatus"), //$NON-NLS-1$
            SWT.NONE);
    gatedCheckinLink.setUnderlined(true);
    gatedCheckinLink.setBackground(parent.getBackground());
    GridDataBuilder.newInstance().hAlignFill().hGrab().applyTo(gatedCheckinLink);

    gatedCheckinLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            Check.notNull(gatedBuild, "gatedBuild"); //$NON-NLS-1$
            new ViewBuildReportTask(
                shell,
                gatedBuild.getBuildServer(),
                gatedBuild.getURI(),
                gatedBuild.getBuildNumber()).run();
        }
    });

    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerDocumentsPage.java   
@Override
public Composite getPageContent(
    final FormToolkit toolkit,
    final Composite parent,
    final int style,
    final TeamExplorerContext context) {
    final Composite composite = toolkit.createComposite(parent);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(composite, 1, true, 0, 5);

    final Hyperlink link =
        toolkit.createHyperlink(
            composite,
            Messages.getString("TeamExplorerDocumentsPage.ShowProjectPortal"), //$NON-NLS-1$
            SWT.WRAP);

    link.setUnderlined(false);
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            final TFSTeamProjectCollection connection = context.getServer().getConnection();
            final ProjectInfo projectInfo = context.getCurrentProjectInfo();

            final String path = WSSUtils.getWSSURL(connection, projectInfo);

            Launcher.launch(path);
        }
    });

    return composite;
}
项目:team-explorer-everywhere    文件:TeamExplorerPendingChangesIncludedSection.java   
@Override
public void createCompositeHeader(
    final FormToolkit toolkit,
    final Composite composite,
    final TeamExplorerContext context) {
    final Composite headerComposite = toolkit.createComposite(composite);

    // Form-style border painting not enabled (0 pixel margins OK) because
    // no applicable controls in this composite
    SWTUtil.gridLayout(headerComposite, 3, false, 0, 0);
    GridDataBuilder.newInstance().applyTo(headerComposite);

    final String title = Messages.getString("TeamExplorerPendingChangesIncludedSection.ExcludeAllLinkText"); //$NON-NLS-1$
    final Hyperlink includeAllHyperlink = toolkit.createHyperlink(headerComposite, title, SWT.WRAP);
    includeAllHyperlink.setUnderlined(false);
    AutomationIDHelper.setWidgetID(includeAllHyperlink, EXCLUDE_ALL_HYPERLINK_ID);
    includeAllHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            getModel().excludeAllPendingChanges();
            clearFilterTextbox();
            TeamExplorerHelpers.updateContainingSectionTitle(treeComposite, getTitle());
        }
    });
    GridDataBuilder.newInstance().applyTo(includeAllHyperlink);

    final Label separator = toolkit.createLabel(headerComposite, "|", SWT.VERTICAL); //$NON-NLS-1$
    GridDataBuilder.newInstance().vFill().applyTo(separator);

    final String linkText = Messages.getString("TeamExplorerPendingChangesIncludedSection.FilterLinkText"); //$NON-NLS-1$
    final Menu menu = createFilterMenu(composite.getShell());
    final ImageHyperlink link = PageHelpers.createDropHyperlink(toolkit, headerComposite, linkText, menu);
    GridDataBuilder.newInstance().applyTo(link);
}
项目:team-explorer-everywhere    文件:TeamExplorerSearchControlPopup.java   
private Hyperlink createFilterHyperlink(
    final Composite parent,
    final FormToolkit toolkit,
    final String text,
    final String filter,
    final String localizedValue,
    final String tooltip) {
    final Hyperlink link = toolkit.createHyperlink(parent, text, SWT.NONE);
    link.setToolTipText(tooltip);

    // Pack the data in the href object
    link.setHref(new String[] {
        filter,
        localizedValue
    });

    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            if (searchControl.isDisposed()) {
                return;
            }

            final String[] values = (String[]) e.getHref();
            searchControl.appendFilter(values[0], values[1]);
        }
    });

    return link;
}
项目:mondo-integration    文件:DetailsFormPage.java   
public InstanceSection(FormToolkit toolkit, Composite parent) {
    super(toolkit, parent, "Instance", "Access details for the remote Hawk instance.");
    cContents.setLayout(Utils.createTableWrapLayout(2));

    this.fldServerURL = new FormTextField(toolkit, cContents, "Server URL:", "");
    this.fldTProtocol = new FormComboBoxField(toolkit, cContents, "Thrift protocol:", ThriftProtocol.strings());
    this.fldInstanceName = new FormTextField(toolkit, cContents, "<a href=\"selectInstance\">Instance name</a>:", "");
    this.fldUsername = new FormTextField(toolkit, cContents, "Username:", "");
    this.fldPassword = new FormTextField(toolkit, cContents, "Password:", "", SWT.BORDER | SWT.PASSWORD);

    fldServerURL.getText().addModifyListener(this);
    fldInstanceName.getText().addModifyListener(this);
    fldTProtocol.getCombo().addSelectionListener(this);
    fldUsername.getText().addModifyListener(this);
    fldPassword.getText().addModifyListener(this);

    fldUsername.getText().setToolTipText(
        "Username to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");
    fldPassword.getText().setToolTipText(
    "Plaintext password to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");

    fldInstanceName.getLabel().addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
            switch (e.getHref().toString()) {
            case "selectInstance":
                selectInstance();
                break;
            }
        }
    });
}
项目:HMM    文件:AutomationPage.java   
protected void createFormContent(final IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    form.setText("HanMeiMei Automation");
    toolkit.decorateFormHeading(form.getForm());
    form.getForm().addMessageHyperlinkListener(new HyperlinkAdapter());
    form.getMessageManager().setDecorationPosition(SWT.RIGHT | SWT.BOTTOM);
    block.createContent(managedForm);
}
项目:mondo-hawk    文件:DetailsFormPage.java   
public InstanceSection(FormToolkit toolkit, Composite parent) {
    super(toolkit, parent, "Instance", "Access details for the remote Hawk instance.");
    cContents.setLayout(Utils.createTableWrapLayout(2));

    this.fldServerURL = new FormTextField(toolkit, cContents, "Server URL:", "");
    this.fldTProtocol = new FormComboBoxField(toolkit, cContents, "Thrift protocol:", ThriftProtocol.strings());
    this.fldInstanceName = new FormTextField(toolkit, cContents, "<a href=\"selectInstance\">Instance name</a>:", "");
    this.fldUsername = new FormTextField(toolkit, cContents, "Username:", "");
    this.fldPassword = new FormTextField(toolkit, cContents, "Password:", "", SWT.BORDER | SWT.PASSWORD);

    fldServerURL.getText().addModifyListener(this);
    fldInstanceName.getText().addModifyListener(this);
    fldTProtocol.getCombo().addSelectionListener(this);
    fldUsername.getText().addModifyListener(this);
    fldPassword.getText().addModifyListener(this);

    fldUsername.getText().setToolTipText(
        "Username to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");
    fldPassword.getText().setToolTipText(
    "Plaintext password to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");

    fldInstanceName.getLabel().addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
            switch (e.getHref().toString()) {
            case "selectInstance":
                selectInstance();
                break;
            }
        }
    });
}
项目:OpenSPIFe    文件:IconAndLinkDetail.java   
@Override
public Control createControl(Composite parent) {
    Hyperlink link = toolkit.createHyperlink(parent, hyperlinkText, SWT.NONE);
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            execute();
        }
    });
    return link;
}
项目:mondo-collab-framework    文件:DetailsFormPage.java   
public InstanceSection(FormToolkit toolkit, Composite parent) {
    super(toolkit, parent, "Instance", "Access details for the remote Hawk instance.");
    cContents.setLayout(Utils.createTableWrapLayout(2));

    this.fldServerURL = new FormTextField(toolkit, cContents, "Server URL:", "");
    this.fldTProtocol = new FormComboBoxField(toolkit, cContents, "Thrift protocol:", ThriftProtocol.strings());
    this.fldInstanceName = new FormTextField(toolkit, cContents, "<a href=\"selectInstance\">Instance name</a>:", "");
    this.fldUsername = new FormTextField(toolkit, cContents, "Username:", "");
    this.fldPassword = new FormTextField(toolkit, cContents, "Password:", "", SWT.BORDER | SWT.PASSWORD);

    fldServerURL.getText().addModifyListener(this);
    fldInstanceName.getText().addModifyListener(this);
    fldTProtocol.getCombo().addSelectionListener(this);
    fldUsername.getText().addModifyListener(this);
    fldPassword.getText().addModifyListener(this);

    fldUsername.getText().setToolTipText(
        "Username to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");
    fldPassword.getText().setToolTipText(
    "Plaintext password to be included in the .hawkmodel file, to log "
    + "into the Hawk Thrift API. To use the Eclipse secure storage "
    + "instead, keep blank.");

    fldInstanceName.getLabel().addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
            switch (e.getHref().toString()) {
            case "selectInstance":
                selectInstance();
                break;
            }
        }
    });
}
项目:idecore    文件:HyperLinkMessageDialog.java   
@Override
protected Control createMessageArea(Composite composite) {
    // create composite
    // create image
    Image image = getImage();
    if (image != null) {
        imageLabel = new Label(composite, SWT.NULL);
        image.setBackground(imageLabel.getBackground());
        imageLabel.setImage(image);
        //            addAccessibleListeners(imageLabel, image);
        GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING).applyTo(imageLabel);
    }

    composite.setLayoutData(new GridData());

    FormText formText = new FormText(composite, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_BOTH);
    formText.setLayoutData(gd);

    StringBuilder buf = new StringBuilder();
    buf.append("<form>"); //$NON-NLS-1$
    buf.append(message);
    buf.append("</form>"); //$NON-NLS-1$

    formText.setText(buf.toString(), true, false);
    formText.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            HyperLinkMessageDialog.this.linkActivated(e);
        }
    });

    return composite;
}
项目:elexis-3-core    文件:DefaultControlFieldProvider.java   
@Override
public Composite createControl(final Composite parent){
    // Form form=tk.createForm(parent);
    // form.setLayoutData(SWTHelper.getFillGridData(1,true,1,false));
    // Composite ret=form.getBody();
    Composite ret = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = 0;
    ret.setLayout(layout);
    ret.setBackground(parent.getBackground());

    ImageHyperlink hClr = tk.createImageHyperlink(ret, SWT.NONE); //$NON-NLS-1$
    hClr.setImage(Images.IMG_CLEAR.getImage());
    hClr.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(final HyperlinkEvent e){
            clearValues();
        }

    });
    hClr.setBackground(parent.getBackground());

    inner = new Composite(ret, SWT.NONE);
    GridLayout lRet = new GridLayout(fields.length, true);
    inner.setLayout(lRet);
    inner.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));

    populateInnerComposite();

    return ret;
}
项目:olca-app    文件:Controls.java   
public static void onClick(Hyperlink link, Consumer<HyperlinkEvent> fn) {
    if (link == null || fn == null)
        return;
    link.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            fn.accept(e);
        }
    });
}
项目:elexis-3-base    文件:RechnungsPrefs.java   
@Override
protected Control createDialogArea(Composite parent){
    Composite ret = new Composite(parent, SWT.NONE);
    ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
    ret.setLayout(new GridLayout(2, false));
    Hyperlink hb =
        UiDesk.getToolkit().createHyperlink(ret,
            Messages.getString("RechnungsPrefs.FinanceInst"), SWT.NONE); //$NON-NLS-1$
    hb.addHyperlinkListener(new HyperlinkAdapter() {

        @Override
        public void linkActivated(HyperlinkEvent e){
            KontaktSelektor ksl =
                new KontaktSelektor(getShell(), Organisation.class, Messages
                    .getString("RechnungsPrefs.paymentinst"), Messages
                    .getString("RechnungsPrefs.PleseChooseBank"), new String[] {
                    Organisation.FLD_NAME1, Organisation.FLD_NAME2
                }); //$NON-NLS-1$ //$NON-NLS-2$
            if (ksl.open() == Dialog.OK) {
                actBank = (Kontakt) ksl.getSelection();
                actMandant.setInfoElement(ta.RNBANK, actBank.getId());
                setMandant(actMandant);
                exTable.setKontakt(actMandant);
            }
        }

    });
    banklabel = new Label(ret, SWT.NONE);
    banklabel.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
    exTable = new KontaktExtDialog.ExtInfoTable(parent, flds);
    exTable.setLayoutData(SWTHelper.getFillGridData(2, true, 1, true));
    exTable.setKontakt(actMandant);
    return ret;
}
项目:team-explorer-everywhere    文件:OAuth2DeviceFlowCallbackDialog.java   
@Override
protected void hookAddToDialogArea(final Composite dialogArea) {
    final GridLayout layout = new GridLayout(3, false);

    layout.marginWidth = getHorizontalMargin();
    layout.marginHeight = getVerticalMargin();
    layout.horizontalSpacing = getHorizontalSpacing();
    layout.verticalSpacing = getVerticalSpacing();
    dialogArea.setLayout(layout);

    final Label verificationUrlLabel =
        SWTUtil.createLabel(dialogArea, Messages.getString("OAuth2DeviceFlowCallbackDialog.DeviceLoginUrlText")); //$NON-NLS-1$
    GridDataBuilder.newInstance().hSpan(layout).hFill().hGrab().applyTo(verificationUrlLabel);

    final String urlLinkText = this.response.getVerificationUri().toString();
    final Hyperlink verificationUrlLink =
        this.toolkit.createHyperlink(dialogArea, urlLinkText, SWT.WRAP | SWT.CENTER);
    GridDataBuilder.newInstance().hSpan(layout).hAlignCenter().applyTo(verificationUrlLink);

    verificationUrlLink.setUnderlined(false);
    verificationUrlLink.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(final HyperlinkEvent e) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(e.getLabel()));
            } catch (PartInitException pie) {
                log.error("Failed to open the verification url in browser.", pie); //$NON-NLS-1$
            } catch (MalformedURLException mue) {
                log.error("Failed to open the verification url in browser: " + e.getLabel(), mue); //$NON-NLS-1$
            }
        }
    });

    final Label codeNameLabel = SWTUtil.createLabel(
        dialogArea,
        MessageFormat.format(
            Messages.getString("OAuth2DeviceFlowCallbackDialog.DeviceUserCodeTextFormat"), //$NON-NLS-1$
            this.response.getExpiresIn() / 60));
    GridDataBuilder.newInstance().hSpan(layout).hFill().hGrab().applyTo(codeNameLabel);

    final Text deviceCodeText = new Text(dialogArea, SWT.READ_ONLY | SWT.BORDER);
    GridDataBuilder.newInstance().hSpan(layout).hFill().applyTo(deviceCodeText);
    deviceCodeText.setText(this.response.getUserCode());
    deviceCodeText.setFocus();

    final Label finishFlowLabel =
        SWTUtil.createLabel(dialogArea, Messages.getString("OAuth2DeviceFlowCallbackDialog.SelectOkText")); //$NON-NLS-1$
    GridDataBuilder.newInstance().hSpan(layout).hFill().hGrab().applyTo(finishFlowLabel);

}
项目:subclipse    文件:LoadErrorDialog.java   
protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.LoadErrorDialog_0);
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label problemLabel = new Label(composite, SWT.WRAP);
    problemLabel.setText(Messages.LoadErrorDialog_1);
    GridData gd = new GridData();
    gd.widthHint = 500;
    problemLabel.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    Label linkLabel = new Label(composite, SWT.WRAP);
    linkLabel.setText(Messages.LoadErrorDialog_2);
    gd = new GridData();
    gd.widthHint = 500;
    linkLabel.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    toolkit.setBackground(parent.getBackground());
    Hyperlink infoLink = toolkit.createHyperlink(composite, "http://subclipse.tigris.org/wiki/JavaHL", SWT.NONE); //$NON-NLS-1$
    infoLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent evt) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("http://subclipse.tigris.org/wiki/JavaHL")); //$NON-NLS-1$
            } catch (Exception e) {}
        }
       });

    new Label(composite, SWT.NULL);

    Group errorGroup = new Group(composite, SWT.NULL);
    GridLayout errorLayout = new GridLayout();
    errorGroup.setLayout(errorLayout);
    gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
    errorGroup.setLayoutData(gd);
    errorGroup.setText(Messages.LoadErrorDialog_4);
    Text errorText = new Text(errorGroup, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.WRAP);
       gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL
               | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL
               | GridData.GRAB_VERTICAL);
       gd.heightHint = 300;
       errorText.setLayoutData(gd);

       if (loadErrors != null) {
        errorText.setText(loadErrors);
       }

    return composite;
}
项目:subclipse    文件:ConfigurationWizardRepositorySourceProviderPage.java   
public void createControl(Composite parent) {
    Composite outerContainer = new Composite(parent,SWT.NONE);
    outerContainer.setLayout(new GridLayout());
    outerContainer.setLayoutData(
    new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));

    Composite treeGroup = new Composite(outerContainer, SWT.NONE);
    GridLayout treeLayout = new GridLayout();
    treeLayout.numColumns = 1;
    treeGroup.setLayout(treeLayout);
    treeGroup.setLayoutData(
    new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));

    treeViewer = new TreeViewer(treeGroup, SWT.BORDER | SWT.SINGLE);
    treeViewer.setLabelProvider(new RepositorySourceLabelProvider());   
    treeViewer.setContentProvider(new RepositorySourceContentProvider());
    treeViewer.setUseHashlookup(true);
    GridData layoutData = new GridData();
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
    layoutData.horizontalAlignment = GridData.FILL;
    layoutData.verticalAlignment = GridData.FILL;
    layoutData.minimumHeight = 300;
    layoutData.minimumWidth = 300;
    treeViewer.getControl().setLayoutData(layoutData);
    treeViewer.setInput(this);

    treeViewer.setSelection(new StructuredSelection("URL"));

    treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            Object selectedObject = ((IStructuredSelection)treeViewer.getSelection()).getFirstElement();
            if (selectedObject instanceof ISVNRepositorySourceProvider) {
                selectedRepositorySourceProvider = (ISVNRepositorySourceProvider)selectedObject;
            }
            else {
                selectedRepositorySourceProvider = null;
            }
            setPageComplete(!treeViewer.getSelection().isEmpty());
        }       
    });

    Hyperlink repositoryProviderLink = new Hyperlink(treeGroup, SWT.NONE);
    repositoryProviderLink.setUnderlined(true);
    repositoryProviderLink.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
    repositoryProviderLink.setText("Click here to see the list of available providers.");
    repositoryProviderLink.setToolTipText(REPOSITORY_PROVIDERS_WIKI_URL);
    repositoryProviderLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent evt) {
            showAvailableProviders();       
        }
    });

       Composite cloudForgeComposite = new CloudForgeComposite(outerContainer, SWT.NONE);
       GridData data = new GridData(GridData.VERTICAL_ALIGN_END | GridData.GRAB_VERTICAL | GridData.FILL_VERTICAL);
       cloudForgeComposite.setLayoutData(data);

    setControl(outerContainer);
}
项目:mesfavoris    文件:BookmarkProblemsTooltip.java   
@Override
protected Composite createToolTipContentArea(Event event, Composite parent) {
    Composite composite = formToolkit.createComposite(parent);
    GridLayout gridLayout = new GridLayout();
    composite.setLayout(gridLayout);
    bookmarkProblemsFormText = formToolkit.createFormText(composite, true);
    bookmarkProblemsFormText.setWhitespaceNormalized(false);
    ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
    bookmarkProblemsFormText.setImage(IMAGE_ERROR_KEY, sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
    bookmarkProblemsFormText.setImage(IMAGE_WARNING_KEY, sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK));
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.minimumWidth = 300;
    gridData.minimumHeight = 50;
    bookmarkProblemsFormText.setLayoutData(gridData);

    Set<BookmarkProblem> problems = bookmarkProblems.getBookmarkProblems(bookmarkId);

    StringBuilder sb = new StringBuilder();
    sb.append("<form>");
    sb.append("<p>List of bookmark problems :</p>");
    for (BookmarkProblem problem : problems) {
        IBookmarkProblemDescriptor bookmarkProblemDescriptor = bookmarkProblems
                .getBookmarkProblemDescriptor(problem.getProblemType());

        String value = bookmarkProblemDescriptor.getSeverity() == Severity.ERROR ? IMAGE_ERROR_KEY
                : IMAGE_WARNING_KEY;
        String message = bookmarkProblemDescriptor.getErrorMessage(problem);
        sb.append(String.format("<li style=\"image\" value=\"%s\">", value));
        sb.append("<span nowrap=\"true\">");
        sb.append(message);
        Optional<IBookmarkProblemHandler> handler = bookmarkProblemDescriptor.getBookmarkProblemHandler();
        if (handler.isPresent()) {
            sb.append(" - ");
        }
        sb.append("</span>");
        if (handler.isPresent()) {
            sb.append(String.format("<a href=\"%s\" nowrap=\"true\">%s</a>", problem.getProblemType(),
                    handler.get().getActionMessage(problem)));
        }
        sb.append("</li>");
    }
    sb.append("</form>");
    bookmarkProblemsFormText.setText(sb.toString(), true, false);
    bookmarkProblemsFormText.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent e) {
            hide();
            handleAction((String) e.getHref());
        }
    });
    return composite;
}
项目:mondo-integration    文件:DetailsFormPage.java   
public ContentSection(FormToolkit toolkit, Composite parent) {
    super(toolkit, parent, "Contents", "Filters on the contents of the index to be read as a model");
    cContents.setLayout(Utils.createTableWrapLayout(2));

    this.fldRepositoryURL = new FormTextField(toolkit, cContents, "<a href=\"selectRepository\">Repository URL</a>:", HawkModelDescriptor.DEFAULT_REPOSITORY);
    this.fldFilePatterns = new FormTextField(toolkit, cContents, "<a href=\"selectFiles\">File pattern(s)</a>:", HawkModelDescriptor.DEFAULT_FILES);
    this.fldLoadingMode = new FormComboBoxField(toolkit, cContents, "Loading mode:", HawkModelDescriptor.LoadingMode.strings());
    this.fldQueryLanguage = new FormTextField(toolkit, cContents, "<a href=\"selectQueryLanguage\">Query language</a>:", HawkModelDescriptor.DEFAULT_QUERY_LANGUAGE);
    this.fldQuery = new FormTextField(toolkit, cContents, "Query:", HawkModelDescriptor.DEFAULT_QUERY);
    this.fldDefaultNamespaces = new FormTextField(toolkit, cContents, "Default namespaces:", HawkModelDescriptor.DEFAULT_DEFAULT_NAMESPACES);
    this.fldSplit = new FormCheckBoxField(toolkit, cContents, "Split by file:", HawkModelDescriptor.DEFAULT_IS_SPLIT);
    this.fldPaged = new FormTextField(toolkit, cContents, "Page size for initial load:", HawkModelDescriptor.DEFAULT_PAGE_SIZE + "");

    this.fldRepositoryURL.getText().setToolTipText(
        "Pattern for the URL repositories to be fetched (* means 0+ arbitrary characters).");
    this.fldFilePatterns.getText().setToolTipText(
        "Comma-separated patterns for the files repositories to be fetched (* means 0+ arbitrary characters).");
    this.fldQueryLanguage.getText().setToolTipText(
        "Language in which the query will be written. If empty, the entire model will be retrieved.");
    this.fldQuery.getText().setToolTipText(
        "Query to be used for the initial contents of the model. If empty, the entire model will be retrieved.");
    this.fldDefaultNamespaces.getText().setToolTipText(
    "Comma-separated list of namespaces used to disambiguate types if multiple matches are found.");
    this.fldSplit.getCheck().setToolTipText(
        "If checked, the contents of the index will be split by file, using surrogate resources. Otherwise, the entire contents of the index will be under this resource (needed for CloudATL).");
    this.fldPaged.getText().setToolTipText(
    "If set to a value > 0, the initial load will be done in two stages: 1 request for the node IDs + N requests for their contents (in batches). Recommended for very large models that cannot be sent in one go.");

    fldRepositoryURL.getText().addModifyListener(this);
    fldFilePatterns.getText().addModifyListener(this);
    fldLoadingMode.getCombo().addSelectionListener(this);
    fldQueryLanguage.getText().addModifyListener(this);
    fldQuery.getText().addModifyListener(this);
    fldDefaultNamespaces.getText().addModifyListener(this);
    fldSplit.getCheck().addSelectionListener(this);
    fldPaged.getText().addModifyListener(this);

    final HyperlinkAdapter hyperlinkListener = new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            switch (e.getHref().toString()) {
            case "selectQueryLanguage":
                selectQueryLanguage();
                break;
            case "selectRepository":
                selectRepository();
                break;
            case "selectFiles":
                selectFiles();
                break;
            }
        }
    };
    this.fldQueryLanguage.getLabel().addHyperlinkListener(hyperlinkListener);
    this.fldRepositoryURL.getLabel().addHyperlinkListener(hyperlinkListener);
    this.fldFilePatterns.getLabel().addHyperlinkListener(hyperlinkListener);
}
项目:PDFReporter-Studio    文件:MapSection.java   
/**
 * @see org.eclipse.ui.views.properties.tabbed.ITabbedPropertySection#createControls(org.eclipse.swt.widgets.Composite,
 *      org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage)
 */
public void createControls(Composite parent,
        TabbedPropertySheetPage tabbedPropertySheetPage) {
    super.createControls(parent, tabbedPropertySheetPage);
    parent.setLayout(new GridLayout(2, false));

    FormText mapPickSuggestion=new FormText(parent, SWT.NONE);
    mapPickSuggestion.setText("<form><p><b>You can pickup the map center, zooom and type by</b><a href=\"\">clicking here</a></p></form>", true, false);
    mapPickSuggestion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false,2,1));
    mapPickSuggestion.setWhitespaceNormalized(true);
    mapPickSuggestion.addHyperlinkListener(new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            BasicInfoMapDialog pickmapDialog = new BasicInfoMapDialog(UIUtils.getShell()) {
                @Override
                protected void configureShell(Shell newShell) {
                    super.configureShell(newShell);
                    UIUtils.resizeAndCenterShell(newShell, 800, 600);
                }
            };
            if(pickmapDialog.open()==Dialog.OK){
                LatLng center=pickmapDialog.getMapCenter();
                int zoom = pickmapDialog.getZoomLevel();
                getElement().setPropertyValue(StandardMapComponent.PROPERTY_LATITUDE_EXPRESSION, new JRDesignExpression(center.getLat()+"f"));
                getElement().setPropertyValue(StandardMapComponent.PROPERTY_LONGITUDE_EXPRESSION, new JRDesignExpression(center.getLng()+"f"));
                getElement().setPropertyValue(StandardMapComponent.PROPERTY_ZOOM_EXPRESSION, new JRDesignExpression(String.valueOf(zoom)));
                getElement().setPropertyValue(StandardMapComponent.PROPERTY_MAP_TYPE, pickmapDialog.getMapType().ordinal());
            }
        }
    });
    createWidget4Property(parent, StandardMapComponent.PROPERTY_MAP_TYPE);
    createWidget4Property(parent,
            StandardMapComponent.PROPERTY_LATITUDE_EXPRESSION);
    createWidget4Property(parent,
            StandardMapComponent.PROPERTY_LONGITUDE_EXPRESSION);
    createWidget4Property(parent,
            StandardMapComponent.PROPERTY_ZOOM_EXPRESSION);

    createWidget4Property(parent,
            StandardMapComponent.PROPERTY_LANGUAGE_EXPRESSION);
    createWidget4Property(parent, StandardMapComponent.PROPERTY_MAP_SCALE);
    IPropertyDescriptor pd = getPropertyDesriptor(StandardMapComponent.PROPERTY_EVALUATION_TIME);
    IPropertyDescriptor gpd = getPropertyDesriptor(StandardMapComponent.PROPERTY_EVALUATION_GROUP);
    getWidgetFactory().createCLabel(parent, pd.getDisplayName());
    widgets.put(pd.getId(), new SPEvaluationTime(parent, this, pd, gpd));
    createWidget4Property(parent, StandardMapComponent.PROPERTY_IMAGE_TYPE);
    createWidget4Property(parent, StandardMapComponent.PROPERTY_ON_ERROR_TYPE);
}
项目:APICloud-Studio    文件:UnsupportedPasswordStoresDialog.java   
protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.UnsupportedPasswordStoresDialog_0);
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label problemLabel = new Label(composite, SWT.WRAP);
    problemLabel.setText(Messages.UnsupportedPasswordStoresDialog_1);
    GridData gd = new GridData();
    gd.widthHint = 500;
    problemLabel.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    Composite linkGroup = new Composite(composite, SWT.NULL);
    GridLayout linkLayout = new GridLayout();
    linkLayout.numColumns = 2;
    linkLayout.marginWidth = 0;
    linkLayout.marginHeight = 0;
    linkGroup.setLayout(linkLayout);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    linkGroup.setLayoutData(gd);

    Label linkLabel = new Label(linkGroup, SWT.NONE);
    linkLabel.setText(Messages.UnsupportedPasswordStoresDialog_2);

    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    toolkit.setBackground(parent.getBackground());
    Hyperlink infoLink = toolkit.createHyperlink(linkGroup, Messages.UnsupportedPasswordStoresDialog_3, SWT.NONE);
    infoLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent evt) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("http://subclipse.tigris.org/wiki/JavaHL#head-3a1d2d3c54791d2d751794e5d6645f1d77d95b32")); //$NON-NLS-1$
            } catch (Exception e) {}
        }
       });

    new Label(linkGroup, SWT.NONE);

    Group configGroup = new Group(composite, SWT.NULL);
    GridLayout configLayout = new GridLayout();
    configLayout.numColumns = 2;
    configLayout.marginWidth = 0;
    configLayout.marginHeight = 0;
    configGroup.setLayout(configLayout);
    gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    configGroup.setLayoutData(gd);
    configGroup.setText(Messages.UnsupportedPasswordStoresDialog_5);

    Label fileLabel = new Label(configGroup, SWT.NONE);
    fileLabel.setText(Messages.UnsupportedPasswordStoresDialog_6);
    Text fileText = new Text(configGroup, SWT.READ_ONLY | SWT.BORDER);
    gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    fileText.setLayoutData(gd);
    fileText.setText(SVNUIPlugin.getPlugin().getConfigFile().getAbsolutePath());
    Label storesLabel = new Label(configGroup, SWT.NONE);
    storesLabel.setText(Messages.UnsupportedPasswordStoresDialog_7);
    Text storesText = new Text(configGroup, SWT.READ_ONLY | SWT.BORDER);
    gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    storesText.setLayoutData(gd);
    String passwordStores = SVNUIPlugin.getPlugin().getPasswordStores();
    if (passwordStores == null) {
        passwordStores = "gnome-keyring";
    }
    storesText.setText(passwordStores);

    new Label(composite, SWT.NONE);

    Label editLabel = new Label(composite, SWT.WRAP);
    editLabel.setText(Messages.UnsupportedPasswordStoresDialog_8);
    gd = new GridData();
    gd.widthHint = 500;
    editLabel.setLayoutData(gd);

    fileText.setFocus();

    return composite;
}
项目:APICloud-Studio    文件:LoadErrorDialog.java   
protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.LoadErrorDialog_0);
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label problemLabel = new Label(composite, SWT.WRAP);
    problemLabel.setText(Messages.LoadErrorDialog_1);
    GridData gd = new GridData();
    gd.widthHint = 500;
    problemLabel.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    Label linkLabel = new Label(composite, SWT.WRAP);
    linkLabel.setText(Messages.LoadErrorDialog_2);
    gd = new GridData();
    gd.widthHint = 500;
    linkLabel.setLayoutData(gd);

    new Label(composite, SWT.NONE);

    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    toolkit.setBackground(parent.getBackground());
    Hyperlink infoLink = toolkit.createHyperlink(composite, "http://subclipse.tigris.org/wiki/JavaHL", SWT.NONE); //$NON-NLS-1$
    infoLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent evt) {
            try {
                PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL("http://subclipse.tigris.org/wiki/JavaHL")); //$NON-NLS-1$
            } catch (Exception e) {}
        }
       });

    new Label(composite, SWT.NULL);

    Group errorGroup = new Group(composite, SWT.NULL);
    GridLayout errorLayout = new GridLayout();
    errorGroup.setLayout(errorLayout);
    gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
    errorGroup.setLayoutData(gd);
    errorGroup.setText(Messages.LoadErrorDialog_4);
    Text errorText = new Text(errorGroup, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.WRAP);
       gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL
               | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL
               | GridData.GRAB_VERTICAL);
       gd.heightHint = 300;
       errorText.setLayoutData(gd);

       if (loadErrors != null) {
        errorText.setText(loadErrors);
       }

    return composite;
}
项目:APICloud-Studio    文件:ConfigurationWizardRepositorySourceProviderPage.java   
public void createControl(Composite parent) {
    Composite outerContainer = new Composite(parent,SWT.NONE);
    outerContainer.setLayout(new GridLayout());
    outerContainer.setLayoutData(
    new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));

    Composite treeGroup = new Composite(outerContainer, SWT.NONE);
    GridLayout treeLayout = new GridLayout();
    treeLayout.numColumns = 1;
    treeGroup.setLayout(treeLayout);
    treeGroup.setLayoutData(
    new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));

    treeViewer = new TreeViewer(treeGroup, SWT.BORDER | SWT.SINGLE);
    treeViewer.setLabelProvider(new RepositorySourceLabelProvider());   
    treeViewer.setContentProvider(new RepositorySourceContentProvider());
    treeViewer.setUseHashlookup(true);
    GridData layoutData = new GridData();
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
    layoutData.horizontalAlignment = GridData.FILL;
    layoutData.verticalAlignment = GridData.FILL;
    layoutData.minimumHeight = 300;
    layoutData.minimumWidth = 300;
    treeViewer.getControl().setLayoutData(layoutData);
    treeViewer.setInput(this);

    treeViewer.setSelection(new StructuredSelection("URL"));

    treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            Object selectedObject = ((IStructuredSelection)treeViewer.getSelection()).getFirstElement();
            if (selectedObject instanceof ISVNRepositorySourceProvider) {
                selectedRepositorySourceProvider = (ISVNRepositorySourceProvider)selectedObject;
            }
            else {
                selectedRepositorySourceProvider = null;
            }
            setPageComplete(!treeViewer.getSelection().isEmpty());
        }       
    });

    Hyperlink repositoryProviderLink = new Hyperlink(treeGroup, SWT.NONE);
    repositoryProviderLink.setUnderlined(true);
    repositoryProviderLink.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
    repositoryProviderLink.setText("Click here to see the list of available providers.");
    repositoryProviderLink.setToolTipText(REPOSITORY_PROVIDERS_WIKI_URL);
    repositoryProviderLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void linkActivated(HyperlinkEvent evt) {
            showAvailableProviders();       
        }
    });

       Composite cloudForgeComposite = new CloudForgeComposite(outerContainer, SWT.NONE);
       GridData data = new GridData(GridData.VERTICAL_ALIGN_END | GridData.GRAB_VERTICAL | GridData.FILL_VERTICAL);
       cloudForgeComposite.setLayoutData(data);

    setControl(outerContainer);
}
项目:mondo-hawk    文件:DetailsFormPage.java   
public ContentSection(FormToolkit toolkit, Composite parent) {
    super(toolkit, parent, "Contents", "Filters on the contents of the index to be read as a model");
    cContents.setLayout(Utils.createTableWrapLayout(2));

    this.fldRepositoryURL = new FormTextField(toolkit, cContents, "<a href=\"selectRepository\">Repository URL</a>:", HawkModelDescriptor.DEFAULT_REPOSITORY);
    this.fldFilePatterns = new FormTextField(toolkit, cContents, "<a href=\"selectFiles\">File pattern(s)</a>:", HawkModelDescriptor.DEFAULT_FILES);
    this.fldLoadingMode = new FormComboBoxField(toolkit, cContents, "Loading mode:", HawkModelDescriptor.LoadingMode.strings());
    this.fldQueryLanguage = new FormTextField(toolkit, cContents, "<a href=\"selectQueryLanguage\">Query language</a>:", HawkModelDescriptor.DEFAULT_QUERY_LANGUAGE);
    this.fldQuery = new FormTextField(toolkit, cContents, "Query:", HawkModelDescriptor.DEFAULT_QUERY);
    this.fldDefaultNamespaces = new FormTextField(toolkit, cContents, "Default namespaces:", HawkModelDescriptor.DEFAULT_DEFAULT_NAMESPACES);
    this.fldSplit = new FormCheckBoxField(toolkit, cContents, "Split by file:", HawkModelDescriptor.DEFAULT_IS_SPLIT);
    this.fldPaged = new FormTextField(toolkit, cContents, "Page size for initial load:", HawkModelDescriptor.DEFAULT_PAGE_SIZE + "");

    this.fldRepositoryURL.getText().setToolTipText(
        "Pattern for the URL repositories to be fetched (* means 0+ arbitrary characters).");
    this.fldFilePatterns.getText().setToolTipText(
        "Comma-separated patterns for the files repositories to be fetched (* means 0+ arbitrary characters).");
    this.fldQueryLanguage.getText().setToolTipText(
        "Language in which the query will be written. If empty, the entire model will be retrieved.");
    this.fldQuery.getText().setToolTipText(
        "Query to be used for the initial contents of the model. If empty, the entire model will be retrieved.");
    this.fldDefaultNamespaces.getText().setToolTipText(
    "Comma-separated list of namespaces used to disambiguate types if multiple matches are found.");
    this.fldSplit.getCheck().setToolTipText(
        "If checked, the contents of the index will be split by file, using surrogate resources. Otherwise, the entire contents of the index will be under this resource (needed for CloudATL).");
    this.fldPaged.getText().setToolTipText(
    "If set to a value > 0, the initial load will be done in two stages: 1 request for the node IDs + N requests for their contents (in batches). Recommended for very large models that cannot be sent in one go.");

    fldRepositoryURL.getText().addModifyListener(this);
    fldFilePatterns.getText().addModifyListener(this);
    fldLoadingMode.getCombo().addSelectionListener(this);
    fldQueryLanguage.getText().addModifyListener(this);
    fldQuery.getText().addModifyListener(this);
    fldDefaultNamespaces.getText().addModifyListener(this);
    fldSplit.getCheck().addSelectionListener(this);
    fldPaged.getText().addModifyListener(this);

    final HyperlinkAdapter hyperlinkListener = new HyperlinkAdapter() {
        @Override
        public void linkActivated(HyperlinkEvent e) {
            switch (e.getHref().toString()) {
            case "selectQueryLanguage":
                selectQueryLanguage();
                break;
            case "selectRepository":
                selectRepository();
                break;
            case "selectFiles":
                selectFiles();
                break;
            }
        }
    };
    this.fldQueryLanguage.getLabel().addHyperlinkListener(hyperlinkListener);
    this.fldRepositoryURL.getLabel().addHyperlinkListener(hyperlinkListener);
    this.fldFilePatterns.getLabel().addHyperlinkListener(hyperlinkListener);
}