Package org.eclipse.ui.forms.events

Examples of org.eclipse.ui.forms.events.HyperlinkAdapter


        SWT.RADIO);
    gd = new GridData();
    gd.horizontalSpan = 4;
    longMessage.setLayoutData(gd);

    final IHyperlinkListener listener = new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        String title = e.getLabel();
        String details = (String)e.getHref();
        if (details==null) {
          details = title;
View Full Code Here


    TableWrapLayout layout = new TableWrapLayout();
    form.getBody().setLayout(layout);
   
    Hyperlink link = toolkit.createHyperlink(form.getBody(), "Click here.",
        SWT.WRAP);
    link.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        System.out.println("Link activated!");
      }
    });
    link.setText("This is an example of a form that is much longer and will need to wrap.");
    layout.numColumns = 2;
    TableWrapData td = new TableWrapData();
    td.colspan = 2;
    link.setLayoutData(td);
    toolkit.createLabel(form.getBody(), "Text field label:");
    Text text = toolkit.createText(form.getBody(), "");
    td = new TableWrapData(TableWrapData.FILL_GRAB);
    text.setLayoutData(td);
    Button button = toolkit.createButton(form.getBody(),
        "An example of a checkbox in a form", SWT.CHECK);
    td = new TableWrapData();
    td.colspan = 2;
    button.setLayoutData(td);
   
    ImageHyperlink ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL);
    ih.setText("Image link with no image");
    ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL);
    ih.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
    ih.setText("Link with image and text");
   
    ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE|ExpandableComposite.CLIENT_INDENT);
    ImageHyperlink eci = toolkit.createImageHyperlink(ec, SWT.NULL);
    eci.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
    ec.setTextClient(eci);
    ec.setText("Expandable Composite title");
    String ctext = "We will now create a somewhat long text so that "+
    "we can use it as content for the expandable composite. "+
    "Expandable composite is used to hide or show the text using the "+
    "toggle control";
    Label client = toolkit.createLabel(ec, ctext, SWT.WRAP);
    ec.setClient(client);
    td = new TableWrapData();
    td.colspan = 2;
    ec.setLayoutData(td);
    ec.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        form.reflow(true);
      }
    });
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TWISTIE|Section.EXPANDED);
    td = new TableWrapData(TableWrapData.FILL);
    td.colspan = 2;
    section.setLayoutData(td);
    section.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        form.reflow(true);
      }
    });
    section.setText("Section title");
    toolkit.createCompositeSeparator(section);
    section.setDescription("This is the description that goes below the title");
    Composite sectionClient = toolkit.createComposite(section);
    sectionClient.setLayout(new GridLayout());
    button = toolkit.createButton(sectionClient, "Radio 1", SWT.RADIO);
    button = toolkit.createButton(sectionClient, "Radio 2", SWT.RADIO);
    section.setClient(sectionClient);

    StringBuffer buf = new StringBuffer();
    buf.append("<form>");
    buf.append("<p>");
    buf.append("Here is some plain text for the text to render; ");
    buf.append("this text is at <a href=\"http://www.eclipse.org\" nowrap=\"true\">http://www.eclipse.org</a> web site.");
    buf.append("</p>");
    buf.append("<p>");
    buf.append("<span color=\"header\" font=\"header\">This text is in header font and color.</span>");
    buf.append("</p>");
    buf.append("<p>This line will contain some <b>bold</b> and some <span font=\"code\">source</span> text. ");
    buf.append("We can also add <img href=\"image\"/> an image. ");
    buf.append("</p>");
    buf.append("<li>A default (bulleted) list item.</li>");
    buf.append("<li>Another bullet list item.</li>");
    buf.append("<li style=\"text\" value=\"1.\">A list item with text.</li>");
    buf.append("<li style=\"text\" value=\"2.\">Another list item with text</li>");
    buf.append("<li style=\"image\" value=\"image\">List item with an image bullet</li>");
    buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"3.\">A list item with text.</li>");
    buf.append("<li style=\"text\" bindent=\"20\" indent=\"40\" value=\"4.\">A list item with text.</li>");
    buf.append("<p>     leading blanks;      more white \n\n new lines   <br/><br/><br/> \n more <b>   bb   </b>  white  . </p>");
    buf.append("</form>");
    FormText rtext = toolkit.createFormText(form.getBody(), false);
    //rtext.setWhitespaceNormalized(false);
    td = new TableWrapData(TableWrapData.FILL);
    td.colspan = 2;
    rtext.setLayoutData(td);
    rtext.setImage("image", ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
    rtext.setColor("header", toolkit.getColors().getColor(IFormColors.TITLE));
    rtext.setFont("header", JFaceResources.getHeaderFont());
    rtext.setFont("code", JFaceResources.getTextFont());
    rtext.setText(buf.toString(), true, false);
    rtext.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        System.out.println("Link active: "+e.getHref());
      }
    });
/*    layout.numColumns = 3;
View Full Code Here

                        mustLinks[i] = toolkit.createHyperlink( mustClient, mustAtd.toString(), SWT.WRAP );
                        mustLinks[i].setHref( mustAtd );
                        mustLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        mustLinks[i].setUnderlined( true );
                        mustLinks[i].setEnabled( true );
                        mustLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                        {
                            public void linkActivated( HyperlinkEvent e )
                            {
                                SchemaBrowser.select( e.getHref() );
                            }
View Full Code Here

                        mayLinks[i] = toolkit.createHyperlink( mayClient, mayAtd.toString(), SWT.WRAP );
                        mayLinks[i].setHref( mayAtd );
                        mayLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        mayLinks[i].setUnderlined( true );
                        mayLinks[i].setEnabled( true );
                        mayLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                        {
                            public void linkActivated( HyperlinkEvent e )
                            {
                                SchemaBrowser.select( e.getHref() );
View Full Code Here

                    subLinks[i] = toolkit.createHyperlink( subClient, subOCDs[i].toString(), SWT.WRAP );
                    subLinks[i].setHref( subOCDs[i] );
                    subLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    subLinks[i].setUnderlined( true );
                    subLinks[i].setEnabled( true );
                    subLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                    {
                        public void linkActivated( HyperlinkEvent e )
                        {
                            SchemaBrowser.select( e.getHref() );
                        }
View Full Code Here

                        superLinks[i] = toolkit.createHyperlink( supClient, supOcd.toString(), SWT.WRAP );
                        superLinks[i].setHref( supOcd );
                        superLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        superLinks[i].setUnderlined( true );
                        superLinks[i].setEnabled( true );
                        superLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                        {
                            public void linkActivated( HyperlinkEvent e )
                            {
                                SchemaBrowser.select( e.getHref() );
                            }
View Full Code Here

        syntaxSection.setClient( syntaxClient );

        toolkit.createLabel( syntaxClient, "Syntax OID:", SWT.NONE );
        syntaxLink = toolkit.createHyperlink( syntaxClient, "", SWT.WRAP );
        syntaxLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        syntaxLink.addHyperlinkListener( new HyperlinkAdapter()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                SchemaBrowser.select( e.getHref() );
            }
View Full Code Here

                    usedFromLinks[i] = toolkit.createHyperlink( usedFromClient, usedFromATDs[i].toString(), SWT.WRAP );
                    usedFromLinks[i].setHref( usedFromATDs[i] );
                    usedFromLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    usedFromLinks[i].setUnderlined( true );
                    usedFromLinks[i].setEnabled( true );
                    usedFromLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                    {
                        public void linkActivated( HyperlinkEvent e )
                        {
                            SchemaBrowser.select( e.getHref() );
                        }
View Full Code Here

                    usedFromLinks[i] = toolkit.createHyperlink( usedFromClient, usedFromATDs[i].toString(), SWT.WRAP );
                    usedFromLinks[i].setHref( usedFromATDs[i] );
                    usedFromLinks[i].setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    usedFromLinks[i].setUnderlined( true );
                    usedFromLinks[i].setEnabled( true );
                    usedFromLinks[i].addHyperlinkListener( new HyperlinkAdapter()
                    {
                        public void linkActivated( HyperlinkEvent e )
                        {
                            SchemaBrowser.select( e.getHref() );
                        }
View Full Code Here

        syntaxSection.setClient( syntaxClient );

        toolkit.createLabel( syntaxClient, "Syntax OID:", SWT.NONE );
        syntaxLink = toolkit.createHyperlink( syntaxClient, "", SWT.WRAP );
        syntaxLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        syntaxLink.addHyperlinkListener( new HyperlinkAdapter()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                SchemaBrowser.select( e.getHref() );
            }
        } );

        toolkit.createLabel( syntaxClient, "Syntax Description:", SWT.NONE );
        syntaxText = toolkit.createText( syntaxClient, "", SWT.NONE );
        syntaxText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        syntaxText.setEditable( false );

        toolkit.createLabel( syntaxClient, "Length:", SWT.NONE );
        lengthText = toolkit.createText( syntaxClient, "", SWT.NONE );
        lengthText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        lengthText.setEditable( false );

        matchSection = toolkit.createSection( detailForm.getBody(), SWT.NONE );
        matchSection.setText( "Matching Rules" );
        matchSection.marginWidth = 0;
        matchSection.marginHeight = 0;
        matchSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( matchSection );

        Composite matchClient = toolkit.createComposite( matchSection, SWT.WRAP );
        GridLayout matchLayout = new GridLayout();
        matchLayout.numColumns = 2;
        matchLayout.marginWidth = 0;
        matchLayout.marginHeight = 0;
        matchClient.setLayout( matchLayout );
        matchSection.setClient( matchClient );

        toolkit.createLabel( matchClient, "Equality match:", SWT.NONE );
        equalityLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
        equalityLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        equalityLink.addHyperlinkListener( new HyperlinkAdapter()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                SchemaBrowser.select( e.getHref() );
            }
        } );

        toolkit.createLabel( matchClient, "Substring match:", SWT.NONE );
        substringLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
        substringLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        substringLink.addHyperlinkListener( new HyperlinkAdapter()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                SchemaBrowser.select( e.getHref() );
            }
        } );

        toolkit.createLabel( matchClient, "Ordering match:", SWT.NONE );
        orderingLink = toolkit.createHyperlink( matchClient, "", SWT.WRAP );
        orderingLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        orderingLink.addHyperlinkListener( new HyperlinkAdapter()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                SchemaBrowser.select( e.getHref() );
            }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.forms.events.HyperlinkAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.