Examples of CoolItem


Examples of org.eclipse.swt.widgets.CoolItem

    }
       
    // Must be the first time, calculate the value
    CoolBar bar = new CoolBar (trim.getControl().getParent(), orientation);
   
    CoolItem item = new CoolItem (bar, SWT.NONE);
   
    Label ctrl = new Label (bar, SWT.PUSH);
    ctrl.setText ("Button 1"); //$NON-NLS-1$
      Point size = ctrl.computeSize (SWT.DEFAULT, SWT.DEFAULT);
   
      Point ps = item.computeSize (size.x, size.y);
    item.setPreferredSize (ps);
    item.setControl (ctrl);

    bar.pack ();

    // OK, now the difference between the location of the CB and the
    // location of the
    Point bl = ctrl.getLocation();
    Point cl = bar.getLocation();

    // Toss them now...
    ctrl.dispose();
    item.dispose();
    bar.dispose();
 
    // The 'size' is the difference between the start of teh CoolBar and
    // start of its first control
    int length;
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

    }
   
    // Create the necessary parts...
    cb = new CoolBar(this, orientation | SWT.FLAT);
    cb.setLocation(0,0);
    ci = new CoolItem(cb, SWT.FLAT);
   
    // Create a composite in order to get the handles to appear
    Composite comp = new Composite(cb, SWT.NONE);
    ci.setControl(comp);
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

    ToolItem toolItemUnderline = new ToolItem(toolBar, SWT.PUSH);
    toolItemBold.setToolTipText("Make Selected Text Underlined");
    toolItemUnderline.setImage(GOIMIcons.getImage(GOIMIcons.CHATWINDOW_UNDERLINE));

    int totalx = 0;
    CoolItem coolItem = new CoolItem(buttonCoolBar, SWT.NULL);
    coolItem.setControl(toolBar);
    toolBar.pack();
    Point size = toolBar.getSize();
    size = coolItem.computeSize(size.x,size.y);
    totalx+=size.x;
    coolItem.setMinimumSize(size);
    coolItem.setPreferredSize(size);
   
    ToolBar sendToolBar = new ToolBar(buttonCoolBar, SWT.FLAT);
   
    ToolItem toolItemSend = new ToolItem(sendToolBar, SWT.PUSH);
    toolItemSend.setToolTipText("Send Input");
    toolItemSend.setText("Send");


    CoolItem sendCoolItem = new CoolItem(buttonCoolBar, SWT.NULL);
    sendCoolItem.setControl(sendToolBar);
    sendToolBar.pack();
    size = sendToolBar.getSize();
    size = sendCoolItem.computeSize(size.x, size.y);
    totalx+=size.x;
    sendCoolItem.setMinimumSize(size);
    sendCoolItem.setPreferredSize(size);
   
   
    //gridData1.minimumWidth = totalx + 30;
    gridData1.widthHint = totalx + 30;
    buttonCoolBar.pack();
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

        toolBarManager.add(new StopVideoSessionAction());
        toolBarManager.add(new PauseVideoSessionAction());
    }

    protected Label createLabel(CoolBar coolBar, String text, String toolTip) {
        CoolItem coolItem = new CoolItem(coolBar, SWT.NONE);
        Label label = new Label(coolBar, SWT.NONE);

        label.setText(text);
        label.setToolTipText(toolTip);
        label.pack();

        Point size = label.getSize();
        size = label.computeSize(size.x, size.y);
        coolItem.setSize(size);
        coolItem.setMinimumSize(size);
        coolItem.setPreferredSize(size);

        coolItem.setControl(label);

        return label;
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

    coolToolItem = CreateNewToolButton("Zav��t aktu�ln�", "window_close.png", new fileCloseItemListener(mainHolder));

   
   
   
    CoolItem coolItem1 = new CoolItem (topCoolBar, SWT.NONE);
    coolItem1.setControl (coolToolBar);
    Point size = coolToolBar.computeSize (SWT.DEFAULT, SWT.DEFAULT);
    coolItem1.setSize (coolItem1.computeSize (size.x, size.y));
   
    /*
    coolToolBar = new ToolBar (topCoolBar, SWT.BORDER);
    coolToolItem = new ToolItem (coolToolBar, SWT.NONE);
    coolToolItem.setText ("Item 3");
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

      frame = new TrimFrame(wbw.getShell());
   
    // Create the necessary parts...
    cb = new CoolBar(frame.getComposite(), orientation | SWT.FLAT);
    ci = new CoolItem(cb, SWT.FLAT);

    // Create (and 'fill') the toolbar
    tbMgr = new ToolBarManager(orientation | SWT.FLAT);
   
    // Have the subclass define any manager content
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

      return item.getParent();
    } else if (widget instanceof ToolTip) {
      ToolTip item = (ToolTip) widget;
      return item.getParent();
    } else if (widget instanceof CoolItem) {
      CoolItem item = (CoolItem) widget;
      return item.getParent();
    } else if (widget instanceof CTabItem) {
      CTabItem item = (CTabItem) widget;
      return item.getParent();
    } else if (widget instanceof ExpandItem) {
      ExpandItem item = (ExpandItem) widget;
      return item.getParent();
    } else if (widget instanceof TabItem) {
      TabItem item = (TabItem) widget;
      return item.getParent();
    } else if (widget instanceof TableColumn) {
      TableColumn item = (TableColumn) widget;
      return item.getParent();
    } else if (widget instanceof TableItem) {
      TableItem item = (TableItem) widget;
      return item.getParent();
    } else if (widget instanceof TableTreeItem) {
      TableTreeItem item = (TableTreeItem) widget;
      return item.getParent();
    } else if (widget instanceof ToolItem) {
      ToolItem item = (ToolItem) widget;
      return item.getParent();
    } else if (widget instanceof TreeColumn) {
      TreeColumn item = (TreeColumn) widget;
      return item.getParent();
    } else if (widget instanceof TreeItem) {
      TreeItem item = (TreeItem) widget;
      return item.getParent();
    } else if (widget instanceof Caret) {
      Caret item = (Caret) widget;
      return item.getParent();
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.PUSH");
    item = new ToolItem(toolBar, SWT.PUSH);
    item.setImage(instance.images[ControlExample.ciOpenFolder]);
    item.setToolTipText("SWT.PUSH");
    pushItem = new CoolItem(coolBar, itemStyle);
    pushItem.setControl(toolBar);
    pushItem.addSelectionListener(new CoolItemSelectionListener());

    /* Create the dropdown toolbar cool item */
    toolBar = new ToolBar(coolBar, toolBarStyle);
    item = new ToolItem(toolBar, SWT.DROP_DOWN);
    item.setImage(instance.images[ControlExample.ciOpenFolder]);
    item.setToolTipText("SWT.DROP_DOWN");
    item.addSelectionListener(new DropDownSelectionListener());
    item = new ToolItem(toolBar, SWT.DROP_DOWN);
    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.DROP_DOWN");
    item.addSelectionListener(new DropDownSelectionListener());
    dropDownItem = new CoolItem(coolBar, itemStyle);
    dropDownItem.setControl(toolBar);
    dropDownItem.addSelectionListener(new CoolItemSelectionListener());

    /* Create the radio button toolbar cool item */
    toolBar = new ToolBar(coolBar, toolBarStyle);
    item = new ToolItem(toolBar, SWT.RADIO);
    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.RADIO");
    item = new ToolItem(toolBar, SWT.RADIO);
    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.RADIO");
    item = new ToolItem(toolBar, SWT.RADIO);
    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.RADIO");
    radioItem = new CoolItem(coolBar, itemStyle);
    radioItem.setControl(toolBar);
    radioItem.addSelectionListener(new CoolItemSelectionListener());

    /* Create the check button toolbar cool item */
    toolBar = new ToolBar(coolBar, toolBarStyle);
    item = new ToolItem(toolBar, SWT.CHECK);
    item.setImage(instance.images[ControlExample.ciClosedFolder]);
    item.setToolTipText("SWT.CHECK");
    item = new ToolItem(toolBar, SWT.CHECK);
    item.setImage(instance.images[ControlExample.ciTarget]);
    item.setToolTipText("SWT.CHECK");
    item = new ToolItem(toolBar, SWT.CHECK);
    item.setImage(instance.images[ControlExample.ciOpenFolder]);
    item.setToolTipText("SWT.CHECK");
    item = new ToolItem(toolBar, SWT.CHECK);
    item.setImage(instance.images[ControlExample.ciTarget]);
    item.setToolTipText("SWT.CHECK");
    checkItem = new CoolItem(coolBar, itemStyle);
    checkItem.setControl(toolBar);
    checkItem.addSelectionListener(new CoolItemSelectionListener());

    /* Create the text cool item */
    if (!vertical) {
      Text text = new Text(coolBar, SWT.BORDER | SWT.SINGLE);
      textItem = new CoolItem(coolBar, itemStyle);
      textItem.setControl(text);
      textItem.addSelectionListener(new CoolItemSelectionListener());
      Point textSize = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      textSize = textItem.computeSize(textSize.x, textSize.y);
      textItem.setMinimumSize(textSize);
      textItem.setPreferredSize(textSize);
      textItem.setSize(textSize);
    }

    /* Set the sizes after adding all cool items */
    CoolItem[] coolItems = coolBar.getItems();
    for (int i = 0; i < coolItems.length; i++) {
      CoolItem coolItem = coolItems[i];
      Control control = coolItem.getControl();
      Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
      Point coolSize = coolItem.computeSize(size.x, size.y);
      if (control instanceof ToolBar) {
        ToolBar bar = (ToolBar) control;
        if (bar.getItemCount() > 0)
          if (vertical)
            size.y = bar.getItem(0).getBounds().height;
          else
            size.x = bar.getItem(0).getWidth();
      }
      coolItem.setMinimumSize(size);
      coolItem.setPreferredSize(coolSize);
      coolItem.setSize(coolSize);
    }

    /* If we have saved state, restore it */
    if (order != null && order.length == coolBar.getItemCount())
      coolBar.setItemLayout(order, wrapIndices, sizes);
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

          menu = null;
          return;
        }

        /* Get the cool item and convert its bounds to display coordinates. */
        CoolItem coolItem = (CoolItem) event.widget;
        Rectangle itemBounds = coolItem.getBounds();
        itemBounds.width = event.x - itemBounds.x;
        Point pt = coolBar.toDisplay(new Point(itemBounds.x, itemBounds.y));
        itemBounds.x = pt.x;
        itemBounds.y = pt.y;

        /* Get the toolbar from the cool item. */
        ToolBar toolBar = (ToolBar) coolItem.getControl();
        ToolItem[] tools = toolBar.getItems();
        int toolCount = tools.length;

        /*
         * Convert the bounds of each tool item to display coordinates, and determine which ones are past the
View Full Code Here

Examples of org.eclipse.swt.widgets.CoolItem

        ToolBar toolBar = new ToolBar(coolBar, SWT.BORDER);
        ToolItem item = new ToolItem(toolBar, 0);
        item.setText(LayoutExample.getResourceString("Item", new String[] { "1" }));
        item = new ToolItem(toolBar, 0);
        item.setText(LayoutExample.getResourceString("Item", new String[] { "2" }));
        CoolItem coolItem1 = new CoolItem(coolBar, 0);
        coolItem1.setControl(toolBar);
        toolBar = new ToolBar(coolBar, SWT.BORDER);
        item = new ToolItem(toolBar, 0);
        item.setText(LayoutExample.getResourceString("Item", new String[] { "3" }));
        item = new ToolItem(toolBar, 0);
        item.setText(LayoutExample.getResourceString("Item", new String[] { "4" }));
        CoolItem coolItem2 = new CoolItem(coolBar, 0);
        coolItem2.setControl(toolBar);
        Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
        coolItem1.setSize(coolItem1.computeSize(size.x, size.y));
        coolItem2.setSize(coolItem2.computeSize(size.x, size.y));
        coolBar.setSize(coolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        children[i] = coolBar;
      } else if (control.equals("Group")) {
        Group group = new Group(layoutComposite, SWT.NONE);
        group.setText(LayoutExample
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.