Package org.eclipse.ui.forms.widgets

Examples of org.eclipse.ui.forms.widgets.Hyperlink


        }
        layout(true);
    }

    public void linkActivated(HyperlinkEvent e) {
        Hyperlink link = (Hyperlink) e.getSource();
        TaskStatus status = (TaskStatus)link.getData(DATA_STATUS_BEAN);
        if (status.getSeverity() == TaskStatus.WARNING || status.getSeverity() == TaskStatus.ERROR) {
            String title = status.getTaskLabel();
            if (status.getSeverity() == TaskStatus.WARNING) {
                title = "WARNING - " + title;
            } else {
View Full Code Here


        factory.createCheckBox(subform, "Auto creation:", "Enabled", "autoCreate");

        Label lblActions = new Label(subform, SWT.NONE);
        lblActions.setText("Actions:");
        HyperlinkGroup actionGroup = new HyperlinkGroup(Display.getCurrent());
        Hyperlink defineMetas = new Hyperlink(subform, SWT.NONE);
        defineMetas.setText("add properties...");
        defineMetas.addHyperlinkListener(new IHyperlinkListener() {           
            public void linkExited(HyperlinkEvent e) {
            }
           
            public void linkEntered(HyperlinkEvent e) {              
            }
           
            public void linkActivated(HyperlinkEvent e) {
                handleAddMetaDataDefinition();               
            }
        });
        actionGroup.add(defineMetas);
       
        Label lbl = new Label(subform, SWT.NONE);
        Hyperlink defineItems = new Hyperlink(subform, SWT.NONE);
        defineItems.setText("add item definition...");
        defineItems.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
            }
           
            public void linkEntered(HyperlinkEvent e) {
View Full Code Here

        txtContentTypeName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
        Label lblActions = new Label(parentInfo, SWT.NONE);
        lblActions.setText("Actions:");
        HyperlinkGroup parentActionGroup = new HyperlinkGroup(Display.getCurrent());
        Hyperlink defineMetas = new Hyperlink(parentInfo, SWT.NONE);
        defineMetas.setText("add properties...");
        defineMetas.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
                // TODO Auto-generated method stub
               
            }
           
            public void linkEntered(HyperlinkEvent e) {
                // TODO Auto-generated method stub
               
            }
           
            public void linkActivated(HyperlinkEvent e) {
                handleAddMetaDataDefinition();               
            }
        });
        parentActionGroup.add(defineMetas);
        Label lbl = new Label(parentInfo, SWT.NONE);
        Hyperlink defineItems = new Hyperlink(parentInfo, SWT.NONE);
        defineItems.setText("add item definition...");
        defineItems.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
                // TODO Auto-generated method stub
               
            }
View Full Code Here

       
      });

      HyperlinkGroup group = new HyperlinkGroup(sectionClient.getDisplay());
     
      _linkOpenAdminPage = new Hyperlink(sectionClient, SWT.NONE);
      _linkOpenAdminPage.setText("Open Admin Page");
      _linkOpenAdminPage.addHyperlinkListener(new HyperlinkAdapter() {

      @Override
      public void linkActivated(HyperlinkEvent e) {
        OpenWGAAdminPage.call(_model.getWgaRuntime());
      }
       
      });     
      Label filler = new Label(sectionClient, SWT.NONE);
     
//      _linkOpenContentManager = new Hyperlink(sectionClient, SWT.NONE);
//      _linkOpenContentManager.setText("Open Content Manager");     
//      _linkOpenContentManager.addHyperlinkListener(new HyperlinkAdapter() {
//        @Override
//      public void linkActivated(HyperlinkEvent e) {
//          OpenContentManager.call(_model.getWgaRuntime());
//      }
//      });
     
      group.add(_linkOpenAdminPage);
     
      TomcatUtils.getInstance().addListener(this);
     
      //group.add(_linkOpenContentManager);
   
    // web app section
        _webAppSection = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
        _webAppSection.setText("Web Applications");

    List<WebApplication> apps = retrieveWebApplications();
    WGAConfiguration config = null;
    try {
      config = _model.getWgaRuntime().retrieveWGAConfig(false);
    } catch (Exception e2) {
      WGADesignerPlugin.getDefault().logError("Unable to read wga configuration." , e2);
    }
    _webAppModel = new WebApplicationsModel(apps, config);
   
    // register as runtime listener to refresh web app model on wga config changes
    _model.getWgaRuntime().addListener(this);
   
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolbar = toolBarManager.createControl(_webAppSection);
  
    Action action1 = new Action("refresh", WGADesignerPlugin.getDefault().getImageRegistry().getDescriptor(WGADesignerPlugin.IMAGE_REFRESH)) {
      public void run() {
        refreshWebApplications();       
      }


    };
    toolBarManager.add(action1);

    toolBarManager.update(true);
    _webAppSection.setTextClient(toolbar);



    sectionClient = toolkit.createComposite(_webAppSection);
    _webAppSection.setClient(sectionClient);
        sectionLayout = new GridLayout();
        sectionLayout.verticalSpacing  =0;
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);

       
        HyperlinkGroup generalHyperLinkGroup = new HyperlinkGroup(sectionClient.getDisplay());
     
      _linkCreateWebApp = new ImageHyperlink(sectionClient, SWT.NONE);
      _linkCreateWebApp.setText("Create new web application");     
      _linkCreateWebApp.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_DESIGN_ADD));
      _linkCreateWebApp.addHyperlinkListener(new HyperlinkAdapter() {

      @Override
      public void linkActivated(HyperlinkEvent e) {
        try {
          WorkbenchUtils.openWizard(WGADesignerPlugin.getDefault().getWorkbench(), ResourceIDs.WIZARD_NEW_WGA_DESIGN, new SingleStructuredSelection(_model.getWgaRuntime().getProject()));
        } catch (CoreException e1) {
          WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getSite().getShell(), "Unable to open wizard 'New WGADesign'", e1);
        }
      }
       
      });
     
           
      generalHyperLinkGroup.add(_linkCreateWebApp);
      filler = new Label(sectionClient, SWT.NONE);
     
 
     
     
       
        _tblWebApplications = new EditableTableControl<WebApplication>(sectionClient, SWT.NONE,SWT.BORDER|SWT.FULL_SELECTION) {

      @Override
      protected boolean isButtonAreaNeeded() {
        return false;
      }
         
     
        };
       
       
       
       
        GridData tblGridData = new GridData(GridData.FILL_BOTH);     
        tblGridData.minimumHeight = 200;
        tblGridData.verticalSpan = 5;
        _tblWebApplications.setLayoutData(tblGridData);
       
        String[] columnNames = new String[] { "Key", "Title", "Domain", "Design" };       
        _tblWebApplications.init(columnNames, _webAppModel);       
       
        Composite tableActionsContainer = new Composite(sectionClient, SWT.NONE);
        tableActionsContainer.setLayout(new GridLayout(1, false));
        tableActionsContainer.setLayoutData(new GridData(SWT.BEGINNING));
       
        GridData linkGridData = new GridData(SWT.BEGINNING);
        linkGridData.verticalAlignment = SWT.TOP;
        Label lblOpenIn = new Label(tableActionsContainer, SWT.NONE);
        lblOpenIn.setLayoutData(GridDataFactory.copyData(linkGridData));
        lblOpenIn.setText("open selected web application in ...");
       
       
        Hyperlink openInBrowser = new Hyperlink(tableActionsContainer, SWT.NONE);
        openInBrowser.setLayoutData(GridDataFactory.copyData(linkGridData));
        openInBrowser.setText("Browser");
        openInBrowser.addHyperlinkListener(new HyperlinkAdapter() {
          @Override
      public void linkActivated(HyperlinkEvent e) {
            handleOpenInBrowser();
          }
        });
       
        Hyperlink openInDesignEditor = new Hyperlink(tableActionsContainer, SWT.NONE);
        openInDesignEditor.setLayoutData(GridDataFactory.copyData(linkGridData));
        openInDesignEditor.setText("Design Editor");
        openInDesignEditor.addHyperlinkListener(new HyperlinkAdapter() {
          @Override
      public void linkActivated(HyperlinkEvent e) {
            handleOpenInDesignEditor();
          }
        });
       
        Hyperlink openInContentManager = new Hyperlink(tableActionsContainer, SWT.NONE);
        openInContentManager.setLayoutData(GridDataFactory.copyData(linkGridData));
      openInContentManager.setText("Content Manager");
      openInContentManager.addHyperlinkListener(new HyperlinkAdapter() {
          @Override
      public void linkActivated(HyperlinkEvent e) {
            handleOpenInContentManager();
          }
        });
     
      Hyperlink openInAdminClient = new Hyperlink(tableActionsContainer, SWT.NONE);
      openInAdminClient.setLayoutData(GridDataFactory.copyData(linkGridData));
      openInAdminClient.setText("Admin Client");
      openInAdminClient.addHyperlinkListener(new HyperlinkAdapter() {
          @Override
      public void linkActivated(HyperlinkEvent e) {
            handleOpenInAdminClient();
          }
        });
View Full Code Here

        toolkit.createLabel(composite, "Version:");
        txtVersion = toolkit.createText(composite, "", SWT.BORDER);
        ToolTips.setupMessageAndToolTipFromSyntax(txtVersion, Constants.BUNDLE_VERSION);

        Hyperlink linkActivator = toolkit.createHyperlink(composite, "Activator:", SWT.NONE);
        txtActivator = toolkit.createText(composite, "", SWT.BORDER);
        ToolTips.setupMessageAndToolTipFromSyntax(txtActivator, Constants.BUNDLE_ACTIVATOR);

        toolkit.createLabel(composite, "Declarative Services:");
        cmbComponents = new Combo(composite, SWT.READ_ONLY);
        cmbComponents.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

        // Content Proposal for the Activator field
        ContentProposalAdapter activatorProposalAdapter = null;

        ActivatorClassProposalProvider proposalProvider = new ActivatorClassProposalProvider();
        activatorProposalAdapter = new ContentProposalAdapter(txtActivator, new TextContentAdapter(), proposalProvider, assistKeyStroke, UIConstants.autoActivationCharacters());
        activatorProposalAdapter.addContentProposalListener(proposalProvider);
        activatorProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
        activatorProposalAdapter.setLabelProvider(new JavaContentProposalLabelProvider());
        activatorProposalAdapter.setAutoActivationDelay(1000);

        // Decorator for the Activator field
        ControlDecoration decorActivator = new ControlDecoration(txtActivator, SWT.LEFT | SWT.CENTER, composite);
        decorActivator.setImage(contentAssistDecoration.getImage());
        if (assistKeyStroke == null) {
            decorActivator.setDescriptionText("Content Assist is available. Start typing to activate");
        } else {
            decorActivator.setDescriptionText(MessageFormat.format("Content Assist is available. Press {0} or start typing to activate", assistKeyStroke.format()));
        }
        decorActivator.setShowOnlyOnFocus(true);
        decorActivator.setShowHover(true);

        // Decorator for the Components combo
        ControlDecoration decorComponents = new ControlDecoration(cmbComponents, SWT.LEFT | SWT.CENTER, composite);
        decorComponents.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
        decorComponents.setDescriptionText("Use Java annotations to detect Declarative Service Components.");
        decorComponents.setShowOnlyOnFocus(false);
        decorComponents.setShowHover(true);

        // Listeners
        txtVersion.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                lock.ifNotModifying(new Runnable() {
                    public void run() {
                        addDirtyProperty(Constants.BUNDLE_VERSION);
                    }
                });
            }
        });
        cmbComponents.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                lock.ifNotModifying(new Runnable() {
                    public void run() {
                        ComponentChoice old = componentChoice;

                        int index = cmbComponents.getSelectionIndex();
                        if (index >= 0 && index < ComponentChoice.values().length) {
                            componentChoice = ComponentChoice.values()[cmbComponents.getSelectionIndex()];
                            if (old != componentChoice) {
                                addDirtyProperty(aQute.bnd.osgi.Constants.SERVICE_COMPONENT);
                                addDirtyProperty(aQute.bnd.osgi.Constants.DSANNOTATIONS);
                                if (old == null) {
                                    cmbComponents.remove(ComponentChoice.values().length);
                                }
                            }
                        }
                    }
                });
            }
        });
        txtActivator.addModifyListener(new ModifyListener() {
            public void modifyText(ModifyEvent ev) {
                lock.ifNotModifying(new Runnable() {
                    public void run() {
                        addDirtyProperty(Constants.BUNDLE_ACTIVATOR);
                    }
                });
                IMessageManager msgs = getManagedForm().getMessageManager();
                String activatorError = null;
                int activatorErrorLevel = IMessageProvider.ERROR;

                String activatorClassName = txtActivator.getText();
                if (activatorClassName != null && activatorClassName.length() > 0) {
                    try {
                        IJavaProject javaProject = getJavaProject();
                        if (javaProject == null) {
                            activatorError = "Cannot validate activator class name, the bnd file is not in a Java project.";
                            activatorErrorLevel = IMessageProvider.WARNING;
                        } else {
                            IType activatorType = javaProject.findType(activatorClassName);
                            if (activatorType == null) {
                                activatorError = "The activator class name is not known in this project.";
                                activatorErrorLevel = IMessageProvider.ERROR;
                            }
                        }
                    } catch (JavaModelException e) {
                        logger.logError("Error looking up activator class name: " + activatorClassName, e);
                    }
                }

                if (activatorError != null) {
                    msgs.addMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, activatorError, null, activatorErrorLevel, txtActivator);
                } else {
                    msgs.removeMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, txtActivator);
                }

                checkActivatorIncluded();
            }
        });
        linkActivator.addHyperlinkListener(new HyperlinkAdapter() {
            @Override
            public void linkActivated(HyperlinkEvent ev) {
                String activatorClassName = txtActivator.getText();
                if (activatorClassName != null && activatorClassName.length() > 0) {
                    try {
View Full Code Here

                    .setText( NLS
                        .bind(
                            Messages.getString( "MatchingRuleDescriptionDetailsPage.UsedFromCount" ), new Object[] { usedFromATDs.size() } ) ); //$NON-NLS-1$
                for ( AttributeTypeDescription atd : usedFromATDs )
                {
                    Hyperlink usedFromLink = toolkit.createHyperlink( usedFromClient, SchemaUtils.toString( atd ),
                        SWT.WRAP );
                    usedFromLink.setHref( atd );
                    usedFromLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    usedFromLink.setUnderlined( true );
                    usedFromLink.setEnabled( true );
                    usedFromLink.addHyperlinkListener( this );
                }
            }
            else
            {
                usedFromSection.setText( NLS.bind( Messages
View Full Code Here

                    .setText( NLS
                        .bind(
                            Messages.getString( "LdapSyntaxDescriptionDetailsPage.UsedFromCount" ), new Object[] { usedFromATDs.size() } ) ); //$NON-NLS-1$
                for ( AttributeTypeDescription atd : usedFromATDs )
                {
                    Hyperlink usedFromLink = toolkit.createHyperlink( usedFromClient, SchemaUtils.toString( atd ),
                        SWT.WRAP );
                    usedFromLink.setHref( atd );
                    usedFromLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    usedFromLink.setUnderlined( true );
                    usedFromLink.setEnabled( true );
                    usedFromLink.addHyperlinkListener( this );
                }
            }
            else
            {
                usedFromSection.setText( NLS.bind( Messages
View Full Code Here

                for ( String name : names )
                {
                    if ( getSchema().hasAttributeTypeDescription( name ) )
                    {
                        AttributeTypeDescription mustAtd = getSchema().getAttributeTypeDescription( name );
                        Hyperlink mustLink = toolkit.createHyperlink( mustClient, SchemaUtils.toString( mustAtd ),
                            SWT.WRAP );
                        mustLink.setHref( mustAtd );
                        mustLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        mustLink.setUnderlined( true );
                        mustLink.setEnabled( true );
                        mustLink.addHyperlinkListener( this );
                    }
                    else
                    {
                        Hyperlink mustLink = toolkit.createHyperlink( mustClient, name, SWT.WRAP );
                        mustLink.setHref( null );
                        mustLink.setUnderlined( false );
                        mustLink.setEnabled( false );
                    }
                }
            }
            else
            {
View Full Code Here

                for ( String name : names )
                {
                    if ( getSchema().hasAttributeTypeDescription( name ) )
                    {
                        AttributeTypeDescription mayAtd = getSchema().getAttributeTypeDescription( name );
                        Hyperlink mayLink = toolkit.createHyperlink( mayClient, SchemaUtils.toString( mayAtd ),
                            SWT.WRAP );
                        mayLink.setHref( mayAtd );
                        mayLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                        mayLink.setUnderlined( true );
                        mayLink.setEnabled( true );
                        mayLink.addHyperlinkListener( this );
                    }
                    else
                    {
                        Hyperlink mayLink = toolkit.createHyperlink( mayClient, name, SWT.WRAP );
                        mayLink.setHref( null );
                        mayLink.setUnderlined( false );
                        mayLink.setEnabled( false );
                    }
                }
            }
            else
            {
View Full Code Here

                    .setText( NLS
                        .bind(
                            Messages.getString( "ObjectClassDescriptionDetailsPage.SubclassesCount" ), new Object[] { subOcds.size() } ) ); //$NON-NLS-1$
                for ( ObjectClassDescription subOcd : subOcds )
                {
                    Hyperlink subLink = toolkit.createHyperlink( subClient, SchemaUtils.toString( subOcd ), SWT.WRAP );
                    subLink.setHref( subOcd );
                    subLink.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
                    subLink.setUnderlined( true );
                    subLink.setEnabled( true );
                    subLink.addHyperlinkListener( this );
                }
            }
            else
            {
                subclassesSection.setText( NLS.bind( Messages
View Full Code Here

TOP

Related Classes of org.eclipse.ui.forms.widgets.Hyperlink

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.