Examples of FormToolkit


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

  @Override
  protected void createFormContent(IManagedForm managedForm) {
   
   
    ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    toolkit.decorateFormHeading(form.getForm());
   
    WidgetFactory factory = new WidgetFactory(toolkit);
   
    form.setText(PAGE_TITLE);

    ColumnLayout layout = new ColumnLayout();
    layout.maxNumColumns = 2;
    form.getBody().setLayout(layout);
   
    // general section
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("General");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();
        GridData fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 2;
        GridData comboLayout = new GridData(GridData.GRAB_HORIZONTAL);
        comboLayout.minimumWidth = 150;
       
        sectionLayout.numColumns = 3;
        sectionClient.setLayout(sectionLayout);
       
        _comboWGADistribution = factory.createCombo(sectionClient, "WGA Distribution:", "wgaDeployment");
        _comboWGADistribution.setLayoutData(comboLayout);
       
//      _btnConfigureWGAInstallations = new Button(sectionClient, SWT.NONE);
//      _btnConfigureWGAInstallations.setText("Configure distributions ...");
//      _btnConfigureWGAInstallations.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
//      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
//        handleConfigureWGADistributions();
//      }
//    });
     
    HyperlinkGroup group = new HyperlinkGroup(sectionClient.getDisplay());     
      ImageHyperlink linkConfigureDistributions = new ImageHyperlink(sectionClient, SWT.None);
      linkConfigureDistributions.setText("Configure distributions ...");
      linkConfigureDistributions.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        handleConfigureWGADistributions();
      }
    });   
      group.add(linkConfigureDistributions);
     
      //factory.createCheckBox(sectionClient, "Output TML-Warnings on server console:", "enabled", "outputTMLWarningsOnConsole");
      //factory.addFiller(sectionClient);
//      factory.createCheckBox(sectionClient, "TML-Script debugger:", "enabled", "tmlScriptDebuggerEnabled");
//      factory.addFiller(sectionClient);
//     
//      factory.createCheckBox(sectionClient, "Java debugging:", "enabled", "javaDebuggerEnabled");
//      factory.addFiller(sectionClient);
     
    group = new HyperlinkGroup(sectionClient.getDisplay());     
      ImageHyperlink linkConfigureGlobalRuntimePreferences = new ImageHyperlink(sectionClient, SWT.None);
      linkConfigureGlobalRuntimePreferences.setText("Configure global runtime settings ...");
      linkConfigureGlobalRuntimePreferences.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        openGeneralPreferencesPage();
      }
    });   
      group.add(linkConfigureGlobalRuntimePreferences);
     
     
      // libraries section
      section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Tomcat libraries");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
     
        GridData fillBoth = new GridData(GridData.FILL_BOTH);
        fillBoth.minimumHeight = 100;
        fillBoth.verticalSpan = 2;
        _lstTomcatLibraries = new List(sectionClient, SWT.BORDER|SWT.MULTI);
        _lstTomcatLibraries.setLayoutData(fillBoth);
        _lstTomcatLibraries.setItems(_model.getTomcatLibraryNames());
       
        _btnAddTomcatLibrary = toolkit.createButton(sectionClient, "add...", SWT.PUSH);
        _btnAddTomcatLibrary.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddTomcatLibrary();
      }
    });
       
        GridData btnLayout = new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_FILL, false, false);
        _btnAddTomcatLibrary.setLayoutData(btnLayout);
     
      _btnRemoveTomcatLibrary = toolkit.createButton(sectionClient, "remove...", SWT.PUSH);
     
      _btnRemoveTomcatLibrary.setLayoutData(btnLayout);       
      _btnRemoveTomcatLibrary.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveTomcatLibrary();
      }
    });
     
      // java section
      section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Java");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
     
        _comboJVM = factory.createCombo(sectionClient, "Execution Environment:", "executionEnvironment");
        _comboJVM.setLayoutData(comboLayout);

//      _txtMinHeap = factory.createText(sectionClient, "Minimum java heap size (in MB):", "minHeapSize");
//      _txtMinHeap.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//      //factory.addFiller(sectionClient);
//      _txtMaxHeap = factory.createText(sectionClient, "Maximum java heap size (in MB):", "maxHeapSize");
//      _txtMaxHeap.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//      //factory.addFiller(sectionClient);
//      _txtMinPerm = factory.createText(sectionClient, "Minimum java permgen size (in MB):", "minPermSize");
//      _txtMinPerm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//      //factory.addFiller(sectionClient);
//      _txtMaxPerm = factory.createText(sectionClient, "Maximum java permgen size (in MB):", "maxPermSize");
//      _txtMaxPerm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
     

     
    Label lbl = toolkit.createLabel(sectionClient, "Additional jvm options:");
      lbl.setLayoutData(new GridData(GridData.BEGINNING));
      _txtJvmOptions = toolkit.createText(sectionClient, "", SWT.MULTI|SWT.BORDER|SWT.V_SCROLL);
      _txtJvmOptions.setData("jvmOptions");
      GridData jvmOptionLayout = new GridData(GridData.FILL_BOTH);
      jvmOptionLayout.minimumHeight = WidgetFactory.computeFontHeight(_txtJvmOptions) * 5;
      _txtJvmOptions.setLayoutData(jvmOptionLayout);
     
View Full Code Here

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

  @Override
  protected void createFormContent(IManagedForm managedForm) {
   
   
    ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    toolkit.decorateFormHeading(form.getForm());

    form.setText(PAGE_TITLE);

    ColumnLayout layout = new ColumnLayout();
    layout.maxNumColumns = 1;
    form.getBody().setLayout(layout);
   
    // management section
        Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Management");

    Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
       
       
        Label lblStateDesc = new Label(sectionClient, SWT.NONE);
        lblStateDesc.setText("State:");
       
        _lblState = new Label(sectionClient, SWT.NONE);
       
        Composite buttonGroup = toolkit.createComposite(sectionClient);
        GridLayout buttonGroupLayout = new GridLayout();       
        buttonGroupLayout.numColumns = 3;
        buttonGroup.setLayout(buttonGroupLayout);
        GridData buttonGroupLayoutData = new GridData();
        buttonGroupLayoutData.horizontalSpan = 2;
        buttonGroup.setLayoutData(buttonGroupLayoutData);
       
      _btnStartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStartRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_START);
      _btnStartRuntime.setText("Start");

      _btnStartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START));
      _btnStartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StartWGARuntime.call(_model.getWgaRuntime());
          //_btnStartRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });

     
      _btnStopRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStopRuntime.setText("Stop");
      _btnStopRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_STOP);
      _btnStopRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_STOP));
      _btnStopRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StopWGARuntime.call();
          //_btnStopRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });
     
     
      _btnRestartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnRestartRuntime.setText("Restart");

      _btnRestartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_RESTART));
      _btnRestartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          RestartWGARuntime.call();
        } catch (Exception ex) {         
        }
      }
       
      });

      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);
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
     */
    protected void createMasterPart( final IManagedForm managedForm, Composite parent )
    {
        FormToolkit toolkit = managedForm.getToolkit();

        // Creating the Section
        Section section = toolkit.createSection( parent, Section.TITLE_BAR | Section.DESCRIPTION );
        section.setText( Messages.getString( "InterceptorsMasterDetailsBlock.AllInterceptors" ) ); //$NON-NLS-1$
        section.setDescription( Messages.getString( "InterceptorsMasterDetailsBlock.SetTheInterceptorsDescription" ) ); //$NON-NLS-1$
        section.marginWidth = 10;
        section.marginHeight = 5;
        Composite client = toolkit.createComposite( section, SWT.WRAP );
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        layout.makeColumnsEqualWidth = false;
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        client.setLayout( layout );
        toolkit.paintBordersFor( client );
        section.setClient( client );

        // Creatig the Table and Table Viewer
        Table table = toolkit.createTable( client, SWT.NULL );
        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 4 );
        gd.heightHint = 20;
        gd.widthHint = 100;
        table.setLayoutData( gd );
        final SectionPart spart = new SectionPart( section );
        managedForm.addPart( spart );
        viewer = new TableViewer( table );
        viewer.addSelectionChangedListener( new ISelectionChangedListener()
        {
            public void selectionChanged( SelectionChangedEvent event )
            {
                managedForm.fireSelectionChanged( spart, event.getSelection() );
            }
        } );
        viewer.setContentProvider( new ArrayContentProvider() );
        viewer.setLabelProvider( new LabelProvider()
        {
            public Image getImage( Object element )
            {
                return ApacheDSConfigurationPlugin.getDefault().getImage(
                    ApacheDSConfigurationPluginConstants.IMG_INTERCEPTOR );
            }


            public String getText( Object element )
            {
                if ( element instanceof InterceptorEnum )
                {
                    return ( ( InterceptorEnum ) element ).getName();

                }

                return super.getText( element );
            }
        } );

        // Creating the button(s)
        addButton = toolkit.createButton( client, Messages.getString( "InterceptorsMasterDetailsBlock.Add" ), SWT.PUSH ); //$NON-NLS-1$
        addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        deleteButton = toolkit.createButton( client,
            Messages.getString( "InterceptorsMasterDetailsBlock.Delete" ), SWT.PUSH ); //$NON-NLS-1$
        deleteButton.setEnabled( false );
        deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        upButton = toolkit.createButton( client, Messages.getString( "InterceptorsMasterDetailsBlock.Up" ), SWT.PUSH ); //$NON-NLS-1$
        upButton.setEnabled( false );
        upButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        downButton = toolkit.createButton( client,
            Messages.getString( "InterceptorsMasterDetailsBlock.Down" ), SWT.PUSH ); //$NON-NLS-1$
        downButton.setEnabled( false );
        downButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        initFromInput();
View Full Code Here

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

     * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
     */
    protected void createFormContent( IManagedForm managedForm )
    {
        ScrolledForm form = managedForm.getForm();
        FormToolkit toolkit = managedForm.getToolkit();
        Composite parent = form.getBody();
        parent.setLayout( new GridLayout( 2, false ) );

        // Error Image
        Label errorImageLabel = toolkit.createLabel( parent, null );
        errorImageLabel.setImage( Display.getCurrent().getSystemImage( SWT.ICON_ERROR ) );

        // Error Label
        toolkit.createLabel( parent, Messages.getString( "ErrorPage.ErrorOpeningTheEditor" ) ); //$NON-NLS-1$

        // Details Label
        Label detailsLabel = toolkit.createLabel( parent, Messages.getString( "ErrorPage.Details" ) ); //$NON-NLS-1$
        detailsLabel.setLayoutData( new GridData( SWT.NONE, SWT.NONE, false, false, 2, 1 ) );

        // Details Text
        Text detailsText = toolkit.createText( parent, "", SWT.MULTI ); //$NON-NLS-1$
        detailsText.setEditable( false );
        detailsText.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true, 2, 1 ) );
        detailsText.setText( ( ( ServerConfigurationEditor ) getEditor() ).getErrorMessage() );
    }
View Full Code Here

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

        Composite parent = form.getBody();
        TableWrapLayout twl = new TableWrapLayout();
        twl.numColumns = 2;
        parent.setLayout( twl );
        FormToolkit toolkit = managedForm.getToolkit();

        Composite composite = toolkit.createComposite( parent );
        composite.setLayout( new GridLayout() );
        TableWrapData compositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP, 1, 2 );
        compositeTableWrapData.grabHorizontal = true;
        composite.setLayoutData( compositeTableWrapData );

        Composite leftComposite = toolkit.createComposite( parent );
        leftComposite.setLayout( new GridLayout() );
        TableWrapData leftCompositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
        leftCompositeTableWrapData.grabHorizontal = true;
        leftComposite.setLayoutData( leftCompositeTableWrapData );

        Composite rightComposite = toolkit.createComposite( parent );
        rightComposite.setLayout( new GridLayout() );
        TableWrapData rightCompositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
        rightCompositeTableWrapData.grabHorizontal = true;
        rightComposite.setLayoutData( rightCompositeTableWrapData );
View Full Code Here

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

        Composite parent = form.getBody();
        TableWrapLayout twl = new TableWrapLayout();
        twl.numColumns = 2;
        parent.setLayout( twl );
        FormToolkit toolkit = managedForm.getToolkit();

        Composite composite = toolkit.createComposite( parent );
        composite.setLayout( new GridLayout() );
        TableWrapData compositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP, 1, 2 );
        compositeTableWrapData.grabHorizontal = true;
        composite.setLayoutData( compositeTableWrapData );

        Composite leftComposite = toolkit.createComposite( parent );
        leftComposite.setLayout( new GridLayout() );
        TableWrapData leftCompositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
        leftCompositeTableWrapData.grabHorizontal = true;
        leftComposite.setLayoutData( leftCompositeTableWrapData );

        Composite rightComposite = toolkit.createComposite( parent );
        rightComposite.setLayout( new GridLayout() );
        TableWrapData rightCompositeTableWrapData = new TableWrapData( TableWrapData.FILL, TableWrapData.TOP );
        rightCompositeTableWrapData.grabHorizontal = true;
        rightComposite.setLayoutData( rightCompositeTableWrapData );
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
     */
    public void createContents( Composite parent )
    {
        FormToolkit toolkit = mform.getToolkit();
        TableWrapLayout layout = new TableWrapLayout();
        layout.topMargin = 5;
        layout.leftMargin = 5;
        layout.rightMargin = 2;
        layout.bottomMargin = 2;
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
     */
    protected void createMasterPart( final IManagedForm managedForm, Composite parent )
    {
        FormToolkit toolkit = managedForm.getToolkit();

        // Creating the Section
        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
        section.setText( Messages.getString( "ExtendedOperationsMasterDetailsBlock.AllExtendedOperations" ) ); //$NON-NLS-1$
        section.marginWidth = 10;
        section.marginHeight = 5;
        Composite client = toolkit.createComposite( section, SWT.WRAP );
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        layout.makeColumnsEqualWidth = false;
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        client.setLayout( layout );
        toolkit.paintBordersFor( client );
        section.setClient( client );

        // Creating the Table and Table Viewer
        Table table = toolkit.createTable( client, SWT.NULL );
        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 2 );
        gd.heightHint = 20;
        gd.widthHint = 100;
        table.setLayoutData( gd );
        final SectionPart spart = new SectionPart( section );
        managedForm.addPart( spart );
        viewer = new TableViewer( table );
        viewer.addSelectionChangedListener( new ISelectionChangedListener()
        {
            public void selectionChanged( SelectionChangedEvent event )
            {
                managedForm.fireSelectionChanged( spart, event.getSelection() );
            }
        } );
        viewer.setContentProvider( new ArrayContentProvider() );
        viewer.setLabelProvider( new LabelProvider()
        {
            public Image getImage( Object element )
            {
                return ApacheDSConfigurationPlugin.getDefault().getImage(
                    ApacheDSConfigurationPluginConstants.IMG_EXTENDED_OPERATION );
            }


            public String getText( Object element )
            {
                if ( element instanceof ExtendedOperationEnum )
                {
                    return ( ( ExtendedOperationEnum ) element ).getName();

                }

                return super.getText( element );
            }
        } );

        // Creating the button(s)
        addButton = toolkit.createButton( client,
            Messages.getString( "ExtendedOperationsMasterDetailsBlock.Add" ), SWT.PUSH ); //$NON-NLS-1$
        addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        deleteButton = toolkit.createButton( client,
            Messages.getString( "ExtendedOperationsMasterDetailsBlock.Delete" ), SWT.PUSH ); //$NON-NLS-1$
        deleteButton.setEnabled( false );
        deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        initFromInput();
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite)
     */
    public void createContents( Composite parent )
    {
        FormToolkit toolkit = mform.getToolkit();
        TableWrapLayout layout = new TableWrapLayout();
        layout.topMargin = 5;
        layout.leftMargin = 5;
        layout.rightMargin = 2;
        layout.bottomMargin = 2;
View Full Code Here

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

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createMasterPart(org.eclipse.ui.forms.IManagedForm, org.eclipse.swt.widgets.Composite)
     */
    protected void createMasterPart( final IManagedForm managedForm, Composite parent )
    {
        FormToolkit toolkit = managedForm.getToolkit();

        // Creating the Section
        Section section = toolkit.createSection( parent, Section.TITLE_BAR );
        section.setText( "All Partitions" );
        section.marginWidth = 10;
        section.marginHeight = 5;
        Composite client = toolkit.createComposite( section, SWT.WRAP );
        GridLayout layout = new GridLayout();
        layout.numColumns = 2;
        layout.makeColumnsEqualWidth = false;
        layout.marginWidth = 2;
        layout.marginHeight = 2;
        client.setLayout( layout );
        toolkit.paintBordersFor( client );
        section.setClient( client );

        // Creatig the Table and Table Viewer
        Table table = toolkit.createTable( client, SWT.NULL );
        GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true, 1, 2 );
        gd.heightHint = 20;
        gd.widthHint = 100;
        table.setLayoutData( gd );
        final SectionPart spart = new SectionPart( section );
        managedForm.addPart( spart );
        viewer = new TableViewer( table );
        viewer.addSelectionChangedListener( new ISelectionChangedListener()
        {
            public void selectionChanged( SelectionChangedEvent event )
            {
                managedForm.fireSelectionChanged( spart, event.getSelection() );
            }
        } );
        viewer.setContentProvider( new ArrayContentProvider() );
        viewer.setLabelProvider( new LabelProvider()
        {
            public Image getImage( Object element )
            {

                return ApacheDSConfigurationPlugin
                    .getDefault()
                    .getImage(
                        ( ( Partition ) element ).isSystemPartition() ? ApacheDSConfigurationPluginConstants.IMG_PARTITION_SYSTEM
                            : ApacheDSConfigurationPluginConstants.IMG_PARTITION );
            }
        } );

        // Creating the button(s)
        addButton = toolkit.createButton( client, "Add...", SWT.PUSH ); //$NON-NLS-1$
        addButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        deleteButton = toolkit.createButton( client, "Delete", SWT.PUSH );
        deleteButton.setEnabled( false );
        deleteButton.setLayoutData( new GridData( SWT.FILL, SWT.BEGINNING, false, false ) );

        initFromInput();
        addListeners();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.