Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ToolBar


                if (coolBar.getLocked()) {
                    coolBar.setLocked(false);
                    locked = true;
                }
            }
            ToolBar toolBar = (ToolBar) coolItem.getControl();
            if ((toolBar == null) || (toolBar.isDisposed())
                    || (toolBar.getItemCount() <= 0)) {
                // if the toolbar does not contain any items then dispose of
                // coolItem
                coolItem.setData(null);
                Control control = coolItem.getControl();
                if ((control != null) && !control.isDisposed()) {
                    control.dispose();
                    coolItem.setControl(null);
                }
                if (!coolItem.isDisposed()) {
                    coolItem.dispose();
                }
            } else {
                // If the toolbar item exists then adjust the size of the cool
                // item
                Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
                        SWT.DEFAULT);
                // Set the preffered size to the size of the toolbar plus trim
                Point preferredSize = coolItem.computeSize(toolBarSize.x,
                        toolBarSize.y);
                coolItem.setPreferredSize(preferredSize);
                // note setMinimumSize must be called before setSize, see PR
                // 15565
                // Set minimum size
                if (getMinimumItemsToShow() != SHOW_ALL_ITEMS) {
                    int toolItemWidth = toolBar.getItems()[0].getWidth();
                    int minimumWidth = toolItemWidth * getMinimumItemsToShow();
                    coolItem.setMinimumSize(minimumWidth, toolBarSize.y);
                } else {
                    coolItem.setMinimumSize(toolBarSize.x, toolBarSize.y);
                }
View Full Code Here


    public void widgetSelected(SelectionEvent e) {
      Object selection = e.getSource();
      if (selection instanceof ToolItem) {
        ToolItem toolItem = (ToolItem)selection;
        ToolBar toolbar = toolItem.getParent();
        if(toolbar != null) {
          ToolItem[] items = toolbar.getItems();
          for (int i = 0; i < items.length; i++) {
            items[i].setSelection(items[i] == toolItem);
          }
        }
        if (!showPage((CatalogElementPage) toolItem.getData())) {
View Full Code Here

    data.top = new FormAttachment(0, 0);
    data.left = new FormAttachment(0, 0);
    data.right = new FormAttachment(100, 0);
    label.setLayoutData(data);

    toolBar = new ToolBar(composite, SWT.BORDER | SWT.FLAT | SWT.VERTICAL);
   

    data = new FormData();
    data.top = new FormAttachment(label, 0);
    data.left = new FormAttachment(0, 0);
View Full Code Here

      int buttonGroupColumns = 1;
      if (toolbarControlCreator != null) {
        buttonGroupColumns = buttonGroupColumns + toolbarControlCreator.getControlCount();
      }
   
    ToolBar toolbar = new ToolBar(viewerPane, SWT.FLAT);
   
    viewerPane.setTopCenter(toolbar);

    ToolBarManager toolbarManager = new ToolBarManager(toolbar);
   
View Full Code Here

        int buttonGroupColumns = 1;
        if (toolbarControlCreator != null) {
            buttonGroupColumns = buttonGroupColumns + toolbarControlCreator.getControlCount();
        }
        ToolBar toolbar = new ToolBar(viewerPane, SWT.FLAT);
        viewerPane.setTopCenter(toolbar);

        ToolBarManager toolbarManager = new ToolBarManager(toolbar);

        if (toolbarControlCreator != null) {
View Full Code Here

                }
            } );
            control.setTopLeft( browserConnectionWidgetControl );

            // tool bar
            actionToolBar = new ToolBar( control, SWT.FLAT | SWT.RIGHT );
            actionToolBar.setLayoutData( new GridData( SWT.END, SWT.NONE, true, false ) );
            actionToolBarManager = new ToolBarManager( actionToolBar );
            control.setTopCenter( actionToolBar );

            // local menu
View Full Code Here

      }
    };
    hudsonAction.setMenuCreator(menuCreator);
    hudsonAction.setImageDescriptor(imageDescriptor);
   
    ToolBar toolbar = new ToolBar(parent, SWT.HORIZONTAL);
    IContributionItem contributionItem = new ActionContributionItem(hudsonAction);
    contributionItem.fill(toolbar, -1);
    toolbar.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
   
    // project count label
    label = new Label(parent, SWT.LEFT);
    label.setText("000 projects");
    label.setVisible(false);
View Full Code Here

        layout.marginHeight = layout.marginWidth = layout.horizontalSpacing = layout.verticalSpacing = 0;
        setLayout(layout);

        // Create a toolbar.
        toolBarMgr = new ToolBarManager(SWT.FLAT);
        ToolBar toolBar = toolBarMgr.createControl(this);
        gid = new GridData();
        gid.horizontalAlignment = GridData.FILL;
        gid.verticalAlignment = GridData.BEGINNING;
        toolBar.setLayoutData(gid);
    }
View Full Code Here

    labels.setLayoutData(gd);
  }

  private void createViewMenu(Composite parent) {
    toolBar = new ToolBar(parent, SWT.FLAT);
    toolItem = new ToolItem(toolBar, SWT.PUSH, 0);

    GridData data = new GridData();
    data.horizontalAlignment = GridData.END;
    toolBar.setLayoutData(data);
View Full Code Here

  /**
   * Remove any drag and drop support and associated listeners hooked for the
   * perspective switcher.
   */
  private void unhookDragSupport() {
    ToolBar bar = perspectiveBar.getControl();

    if (bar == null || bar.isDisposed() || dragListener == null) {
      return;
    }
    PresentationUtil.removeDragListener(bar, dragListener);
    DragUtil.removeDragTarget(perspectiveBar.getControl(), dragTarget);
    dragListener = null;
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.ToolBar

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.