Package org.eclipse.ui.forms.widgets

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


    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createToolBarActions(org.eclipse.ui.forms.IManagedForm)
     */
    protected void createToolBarActions( IManagedForm managedForm )
    {
        final ScrolledForm form = managedForm.getForm();

        // Horizontal layout Action
        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.HORIZONTAL );
                form.reflow( true );
            }
        };
        horizontalAction.setChecked( true );
        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
        horizontalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_HORIZONTAL_ORIENTATION ) );

        // Vertical layout Action
        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.VERTICAL );
                form.reflow( true );
            }
        };
        verticalAction.setChecked( false );
        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
        verticalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_VERTICAL_ORIENTATION ) );

        form.getToolBarManager().add( horizontalAction );
        form.getToolBarManager().add( verticalAction );
    }
View Full Code Here


    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createToolBarActions(org.eclipse.ui.forms.IManagedForm)
     */
    protected void createToolBarActions( IManagedForm managedForm )
    {
        final ScrolledForm form = managedForm.getForm();

        // Horizontal layout Action
        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.HORIZONTAL );
                form.reflow( true );
            }
        };
        horizontalAction.setChecked( true );
        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
        horizontalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_HORIZONTAL_ORIENTATION ) );

        // Vertical layout Action
        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.VERTICAL );
                form.reflow( true );
            }
        };
        verticalAction.setChecked( false );
        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
        verticalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_VERTICAL_ORIENTATION ) );

        form.getToolBarManager().add( horizontalAction );
        form.getToolBarManager().add( verticalAction );
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.ui.forms.MasterDetailsBlock#createToolBarActions(org.eclipse.ui.forms.IManagedForm)
     */
    protected void createToolBarActions( IManagedForm managedForm )
    {
        final ScrolledForm form = managedForm.getForm();

        // Horizontal layout Action
        Action horizontalAction = new Action( "Horizontal layout", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.HORIZONTAL );
                form.reflow( true );
            }
        };
        horizontalAction.setChecked( true );
        horizontalAction.setToolTipText( "Horizontal Orientation" ); //$NON-NLS-1$
        horizontalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_HORIZONTAL_ORIENTATION ) );

        // Vertical layout Action
        Action verticalAction = new Action( "Vertical Orientation", Action.AS_RADIO_BUTTON ) { //$NON-NLS-1$
            public void run()
            {
                sashForm.setOrientation( SWT.VERTICAL );
                form.reflow( true );
            }
        };
        verticalAction.setChecked( false );
        verticalAction.setToolTipText( "Vertical Orientation" ); //$NON-NLS-1$
        verticalAction.setImageDescriptor( Activator.getDefault().getImageDescriptor(
            PluginConstants.IMG_VERTICAL_ORIENTATION ) );

        form.getToolBarManager().add( horizontalAction );
        form.getToolBarManager().add( verticalAction );
    }
View Full Code Here

    parentGridData.heightHint = 500;
    parentGridData.widthHint = 500;
    parent.setLayoutData(parentGridData);
    //super.createDialogArea(parent);
    FormToolkit tk = GOIMPlugin.getFormToolkit(parent.getDisplay());
    ScrolledForm form = tk.createScrolledForm(parent);
    form.setText("Gamers Own Instant Messenger - Credits");
    form.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
    String aboutText = Platform.getProduct().getProperty(CREDIT_PROPERTY);
   
//    StringBuffer buf = new StringBuffer();
//    buf.append("<form>")
//      .append("<p>")
//      .append("<span color=\"header\" font=\"header\">Gamers Own Instant Messenger</span><br/>")
//      .append("<img href=\"aboutImage\" align=\"bottom\" /></p><p>")
//      .append(aboutText.replace("\n","<br/>"))
//      .append("</p><p>")
//      .append("<span color=\"header\" font=\"header\">Credits</span><br/><br/>")
//      .append("</p>")
//      .append("<li><b>Herbert Poul</b></li>")
//      .append("<li bindent=\"20\">Coming soon</li>")
//      .append("</form>");
   
    TableWrapLayout formBodyLayout = new TableWrapLayout();
    formBodyLayout.leftMargin = 10;
    form.getBody().setLayout(formBodyLayout);
    form.getBody().setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
    FormText text = tk.createFormText(form.getBody(),true);
//    text.setText(buf.toString(),true,true);
    text.setText(aboutText,true,true);
//    text.setImage("aboutImage",img);
//    text.setColor("header",tk.getColors().getColor(FormColors.TITLE));
//    text.setFont( "header",JFaceResources.getHeaderFont());
    TableWrapData tableWrapData = new TableWrapData(TableWrapData.FILL);
    text.setLayoutData(tableWrapData);
   
    text.addHyperlinkListener(new IHyperlinkListener(){
      public void linkEntered(HyperlinkEvent e) {
      }
      public void linkExited(HyperlinkEvent e) {
      }
      public void linkActivated(HyperlinkEvent e) {
        try {
          PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL((String)e.data));
        } catch (PartInitException e1) {
          e1.printStackTrace();
        } catch (MalformedURLException e1) {
          e1.printStackTrace();
        }
      }});

    return form.getContent();
  }
View Full Code Here

  public HeaderPageWithSash(MultiPageEditor formEditor, String pageTitle) {
    super(formEditor, pageTitle);
  }

  protected void createToolBarActions(IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();

    haction = new Action("hor", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
      public void run() {
        sashForm.setOrientation(SWT.HORIZONTAL);
        form.reflow(true);
      }
    };
    haction.setChecked(true);
    haction.setToolTipText("Horizontal Orientation");
    haction.setImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
    haction.setDisabledImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));

    vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
      public void run() {
        sashForm.setOrientation(SWT.VERTICAL);
        form.reflow(true);
      }
    };
    vaction.setChecked(false);
    vaction.setToolTipText("Vertical Orientation");
    vaction.setImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
    vaction.setDisabledImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
    form.getToolBarManager().add(haction);
    form.getToolBarManager().add(vaction);
    form.updateToolBar();
    maybeInitialize(managedForm);
  }
View Full Code Here

    section.setLayoutData(new GridData(GridData.FILL_BOTH));
    return section;
  }

  public Composite setup1ColumnLayout(IManagedForm managedForm) {
    final ScrolledForm sform = managedForm.getForm();
    final Composite form = sform.getBody();
    form.setLayout(new GridLayout(1, false)); // this is required !
    Composite xtra = toolkit.createComposite(form);
    xtra.setLayout(new GridLayout(1, false));
    xtra.setLayoutData(new GridData(GridData.FILL_BOTH));
View Full Code Here

    return xtra;
  }

  // this method creates no new composites.
  public Composite setup2ColumnGrid(IManagedForm managedForm, boolean equalWidth) {
    final ScrolledForm sform = managedForm.getForm();
    final Composite form = sform.getBody();
    GridLayout layout = new GridLayout(2, equalWidth);
    form.setLayout(layout);
    form.setLayoutData(new GridData(GridData.FILL_BOTH));
    return form;
  }
View Full Code Here

    form.setLayoutData(new GridData(GridData.FILL_BOTH));
    return form;
  }

  public Form2Panel setup2ColumnLayout(IManagedForm managedForm, int w1, int w2) {
    final ScrolledForm sform = managedForm.getForm();
    final Composite form = sform.getBody();
    form.setLayout(new GridLayout(1, false)); // this is required !
    Composite xtra = toolkit.createComposite(form);
    xtra.setLayout(new GridLayout(1, false));
    xtra.setLayoutData(new GridData(GridData.FILL_BOTH));
    Control c = xtra.getParent();
View Full Code Here

      // a hack - based on first column more likely being wider
      return setup2ColumnLayout(managedForm, 60, 40);
  }

  public Form2Panel setup2ColumnLayoutNotSash(IManagedForm managedForm, boolean equalWidth) {
    final ScrolledForm sform = managedForm.getForm();
    final Composite form = sform.getBody();
    GridLayout layout = new GridLayout(2, equalWidth);
    form.setLayout(layout);
    form.setLayoutData(new GridData(GridData.FILL_BOTH));
    leftPanel = newComposite(form);
    rightPanel = newComposite(form);
    // strategy for setting size hints of right and left panels
    // Why set hints? Because they make the inner containing things
    // scroll horiz. if they're too wide (useful for aggregates having
    // long names).
    // What hint to set? The hint should be the smallest size you want
    // with child scrolling, before the tabbed page container itself
    // gets a scroll bar.
    // When in the life cycle to do this? Only need to do it once, but
    // after the Grid Layout has happened. This can be the first resizing
    // event (learned this by debugging)

    sform.addListener(SWT.Resize, new Listener() {
      public void handleEvent(Event event) {
        float col1CurrentWidth = leftPanel.getSize().x;
        float col2CurrentWidth = rightPanel.getSize().x;
        final int minLeftPanelWidth = 250; // in pels
        final int minRightPanelWidth = (int) (col2CurrentWidth * minLeftPanelWidth / col1CurrentWidth);
        ((GridData) leftPanel.getLayoutData()).widthHint = minLeftPanelWidth;
        ((GridData) rightPanel.getLayoutData()).widthHint = minRightPanelWidth;
        sform.removeListener(SWT.Resize, this); // only do this one time
      }
    });
    return new Form2Panel(form, leftPanel, rightPanel);
  }
View Full Code Here

  public HeaderPageWithSash(MultiPageEditor formEditor, String pageTitle) {
    super(formEditor, pageTitle);
  }

  protected void createToolBarActions(IManagedForm managedForm) {
    final ScrolledForm form = managedForm.getForm();

    haction = new Action("hor", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
      public void run() {
        sashForm.setOrientation(SWT.HORIZONTAL);
        form.reflow(true);
      }
    };
    haction.setChecked(true);
    haction.setToolTipText("Horizontal Orientation");
    haction.setImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
    haction.setDisabledImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));

    vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
      public void run() {
        sashForm.setOrientation(SWT.VERTICAL);
        form.reflow(true);
      }
    };
    vaction.setChecked(false);
    vaction.setToolTipText("Vertical Orientation");
    vaction.setImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
    vaction.setDisabledImageDescriptor(TAEConfiguratorPlugin
            .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
    form.getToolBarManager().add(haction);
    form.getToolBarManager().add(vaction);
    form.updateToolBar();
    maybeInitialize(managedForm);
  }
View Full Code Here

TOP

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

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.