Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.CTabItem


   * @param control
   *            is the control to be placed in an item
   * @return a new item
   */
  private CTabItem createItem(int index, Control control) {
    CTabItem item = new CTabItem(getTabFolder(), SWT.NONE, index);
    item.setControl(control);
    return item;
  }
View Full Code Here


    Assert.isTrue(pageIndex >= 0 && pageIndex < getPageCount());
    // get editor (if any) before disposing item
    IEditorPart editor = getEditor(pageIndex);

    // get control for the item if it's not an editor
    CTabItem item = getItem(pageIndex);
    Control pageControl = item.getControl();

    // dispose item before disposing editor, in case there's an exception
    // in editor's dispose
    item.dispose();

    if (pageControl != null) {
      pageControl.dispose();
    }
View Full Code Here

  public static SWTEventHandler createSWTEventHandler(final Profile profile) {
    final Holder<SWTEventHandler> eh = new Holder<SWTEventHandler>(null);
    display.syncExec(new Runnable() {
      @Override
      public void run() {
        CTabItem tab = new CTabItem(tabs, SWT.CLOSE);
        Composite composite = new Composite(tabs, SWT.NULL);
        final SWTEventHandler seh = new SWTEventHandler(composite, profile);
        tab.addDisposeListener(new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent arg0) {
            try {
              seh.getFirstConnection().getProfile().dispose();
            } catch(Exception e) {}
          }});
        tab.setControl(composite);
        tabs.setSelection(tab);
        selectedGui = seh;
        setTitle(seh.toString());

        // TODO: Set the divider location
View Full Code Here

  folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
  folder.setSimple(false);
  folder.setUnselectedImageVisible(true);
  folder.setUnselectedCloseVisible(true);
  for (int i = 0; i < 8; i++) {
    CTabItem item = new CTabItem(folder, SWT.CLOSE);
    item.setText("Item "+i);
    item.setImage(image);
    Text text = new Text(folder, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
    text.setText("Text for item "+i+"\n\none, two, three\n\nabcdefghijklmnop");
    item.setControl(text);
  }
  folder.setMinimizeVisible(true);
  folder.setMaximizeVisible(true);
  folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
    @Override
View Full Code Here

  private TabSession session;
 
  private StringBuffer tmpBuf;
 
  public TabItem(final CTabFolder folder) {
    tab = new CTabItem(folder, SWT.CLOSE);
    text = new StyledText(folder, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.WRAP);
    tab.setControl(text);
    text.setEditable(false);
  }
View Full Code Here

  public CTabItem init() {
    server = service.listById(id);
    Image subImage = new Image(tabFolder.getShell().getDisplay(),
        getClass().getResourceAsStream("/subscribe.png"));
   
    tbtmNewItem = new CTabItem(tabFolder, SWT.NONE);
    tbtmNewItem.setShowClose(true);
    composite_3 = new Composite(tabFolder, SWT.NONE);
    tbtmNewItem.setControl(composite_3);
    composite_3.setLayout(new GridLayout(1, false));
    tbtmNewItem.setText(server.getName() +" "+RedisClient.i18nFile.getText(I18nFile.SUBSCRIBE));
    tbtmNewItem.setImage(subImage);
   
    Composite composite_4 = new Composite(composite_3, SWT.NONE);
    composite_4.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    composite_4.setLayout(new GridLayout(3, false));
   
    lblNewLabel = new Label(composite_4, SWT.NONE);
    lblNewLabel.setBounds(0, 0, 55, 15);
    lblNewLabel.setText(RedisClient.i18nFile.getText(I18nFile.CHANNEL));
   
    final Text channel = new Text(composite_4, SWT.BORDER);
    channel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    channel.setBounds(0, 0, 88, 23);
    channel.addControlListener(new ControlAdapter() {
      @Override
      public void controlResized(ControlEvent e) {
        channel.setFocus();
      }
    });
   
    btnNewButton = new Button(composite_4, SWT.NONE);
    btnNewButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    btnNewButton.setBounds(0, 0, 75, 25);
    btnNewButton.setText(RedisClient.i18nFile.getText(I18nFile.SUBSCRIBE));
   
    Composite composite_5 = new Composite(composite_3, SWT.NONE);
    composite_5.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    composite_5.setLayout(new GridLayout(1, false));
   
    final CTabFolder tabFolder_2 = new CTabFolder(composite_5, SWT.BORDER);
    tabFolder_2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    tabFolder_2.setBounds(0, 0, 156, 125);
    tabFolder_2.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
   
    btnNewButton.addSelectionListener(new SelectionAdapter() {
     
      @Override
      public void widgetSelected(SelectionEvent e) {
        if(channel.getText().length() > 0){
          final String subChannel = channel.getText();
                   
          SubChannel subedChannel = new SubChannel(id, subChannel, tabFolder_2);
          final CTabItem tbtmSubItem = subedChannel.init();
          subChannels.add(subedChannel);
         
          tbtmSubItem.addDisposeListener(new DisposeListener() {
            @Override
            public void widgetDisposed(DisposeEvent e) {
              subChannels.remove(tbtmSubItem);
            }
          });
View Full Code Here

    this.tabFolder = tabFolder;
  }
 
 
  public CTabItem init(){
    tbtmSubItem = new CTabItem(tabFolder, SWT.NONE);
    tbtmSubItem.setShowClose(true);
    Composite composite = new Composite(tabFolder, SWT.NONE);
    tbtmSubItem.setControl(composite);
    composite.setLayout(new GridLayout(1, false));
    tbtmSubItem.setText(subChannel + " " + RedisClient.i18nFile.getText(I18nFile.CHANNEL));
View Full Code Here

  public CTabItem init(){
    server = service.listById(id);
    Image pubImage = new Image(tabFolder.getShell().getDisplay(),
        getClass().getResourceAsStream("/publish.png"));
   
    tbtmNewItem = new CTabItem(tabFolder, SWT.NONE);
    tbtmNewItem.setShowClose(true);
    composite_3 = new Composite(tabFolder, SWT.NONE);
    tbtmNewItem.setControl(composite_3);
    composite_3.setLayout(new GridLayout(1, false));
    tbtmNewItem.setText(server.getName() +" "+RedisClient.i18nFile.getText(I18nFile.PUBLISH));
View Full Code Here

  @Override
  public void execute() {
    super.execute();
   
    if(result.getType() != ResultType.Error){
      tbtmNewItem = new CTabItem(console.getTabFolder_2(), SWT.NONE);
      tbtmNewItem.setText(RedisClient.i18nFile.getText(I18nFile.DATA)+(console.getTabFolder_2().indexOf(tbtmNewItem)));
      Composite composite = new Composite(console.getTabFolder_2(), SWT.NONE);
      tbtmNewItem.setControl(composite);
      composite.setLayout(new GridLayout(1, false));
     
View Full Code Here

    tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(
        SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
    tabFolder.setFocus();
    tabFolder.setLayout(new GridLayout(1, false));

    mainTabItem = new CTabItem(tabFolder, SWT.NONE);
    mainTabItem.setText(i18nFile.getText(I18nFile.REDISDATAEXPLORER));

    initTable(tabFolder);

    tabFolder_1 = new CTabFolder(sashForm_1, SWT.BORDER);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.CTabItem

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.