Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.TableTreeItem


    }
    throw new InternalErrorCDE("invalid state"); //$NON-NLS-1$
  }

  public static int getIndex(TableTreeItem item) {
    TableTreeItem parent = item.getParentItem();
    TableTreeItem[] items = (null == parent) ? item.getParent().getItems() : parent.getItems();
    for (int i = items.length - 1; i >= 0; i--) {
      if (items[i] == item)
        return i;
    }
    throw new InternalErrorCDE("invalid state"); //$NON-NLS-1$
View Full Code Here


    }
    return filePathName;
  }

  public static void swapTableTreeItems(TableTreeItem itemBelow, int newSelection) {
    TableTreeItem parent = itemBelow.getParentItem();
    if (null == parent)
      throw new InternalErrorCDE("invalid arg");
    int i = getIndex(itemBelow);
    TableTreeItem itemAbove = parent.getItems()[i - 1];
    TableTreeItem newItemAbove = new TableTreeItem(parent, SWT.NONE, i - 1);
    copyTableTreeItem(newItemAbove, itemBelow);
    TableTreeItem newItemBelow = new TableTreeItem(parent, SWT.NONE, i);
    copyTableTreeItem(newItemBelow, itemAbove);
    itemAbove.dispose();
    itemBelow.dispose();
    parent.getParent().setSelection(new TableTreeItem[] { parent.getItems()[newSelection] });
  }
View Full Code Here

    }
    target.setData(source.getData());
  }

  public static void swapIndexKeys(TableTreeItem itemBelow, int newSelection) {
    TableTreeItem parent = itemBelow.getParentItem();
    FsIndexDescription fsid = getFsIndexDescriptionFromTableTreeItem(parent);
    int i = getIndex(itemBelow);
    FsIndexKeyDescription[] keys = fsid.getKeys();
    FsIndexKeyDescription temp = keys[i];
    keys[i] = keys[i - 1];
View Full Code Here

         if(items[g].toString().endsWith( epiName)){
           //System.out.println("poof: match");
           return;
         }
         }
         TableTreeItem item = new TableTreeItem(tableToAdd,SWT.NULL);
         TableTreeItem subItemURL = new TableTreeItem(item, SWT.NULL);
         TableTreeItem subItemComments = new TableTreeItem(item, SWT.NULL);
       
         if (tableCounter == true){
            Color gray_color = new Color(display,240,240,240);
            item.setBackground( gray_color);
            //tableCounter = false;
            gray_color.dispose() ;
            }
           item.setText(0,epiName);
            item.setText(1,epiNumber);
            subItemURL.setText("URL: ");
            subItemComments.setText("Comments: ");
            tableCounter = false;
          

   
 
View Full Code Here

    if (oldEditor != null)
      oldEditor.dispose()
    // Identify the selected row
    TableTreeItem[] selection = listEpsTree.getSelection();
    if (selection.length == 0) return;
    final TableTreeItem item = selection[0];
    // The control that will be the editor must be a child of the Table
    // that underlies the TableTree
    final Text text = new Text(listEpsTree.getTable(), SWT.NONE);
    //text.moveAbove(tableTree);
    //The text editor must have the same size as the cell and must
    //not be any smaller than 50 pixels.
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;
    //editor.minimumWidth = 50;
    // Open the text editor in the second column of the selected row.
    editor.setEditor (text, item, 1);
    // Assign focus to the text control
    text.setText( item.getText(1) );
    text.setFocus ();
   
    //Listener for editor
    text.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        int escPressed=0;
        switch (e.character){
          case SWT.CR: escPressed=1;break;
        }
        if (escPressed == 1){
          lines[1] = item.getText(0);
          lines[2] = text.getText();
          //System.out.println(lines[1] + " | " + lines[2]);
          epiMaker = new EpiMaker();
          epiMaker.commentWriter(pluginInterface, lines);
            Control oldEditor = editor.getEditor();
          if (oldEditor != null)
          {
            oldEditor.dispose();
          }
          if (!item.isDisposed())
          item.setText(1, lines[2])
         
       
        }
      }
      public void keyReleased (KeyEvent e) {
View Full Code Here

         if(items[g].toString().endsWith( epiName)){
           //System.out.println("poof: match");
           return;
         }
         }
         TableTreeItem item = new TableTreeItem(tableToAdd,SWT.NULL);
         TableTreeItem subItemURL = new TableTreeItem(item, SWT.NULL);
         TableTreeItem subItemComments = new TableTreeItem(item, SWT.NULL);
       
         if (tableCounter == true){
            Color gray_color = new Color(display,240,240,240);
            item.setBackground( gray_color);
            //tableCounter = false;
            gray_color.dispose() ;
            }
           item.setText(0,epiName);
            item.setText(1,epiNumber);
            subItemURL.setText("URL: ");
            subItemComments.setText("Comments: ");
            tableCounter = false;
          

   
 
View Full Code Here

    if (oldEditor != null)
      oldEditor.dispose()
    // Identify the selected row
    TableTreeItem[] selection = listEpsTree.getSelection();
    if (selection.length == 0) return;
    final TableTreeItem item = selection[0];
    // The control that will be the editor must be a child of the Table
    // that underlies the TableTree
    final Text text = new Text(listEpsTree.getTable(), SWT.NONE);
    //text.moveAbove(tableTree);
    //The text editor must have the same size as the cell and must
    //not be any smaller than 50 pixels.
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;
    //editor.minimumWidth = 50;
    // Open the text editor in the second column of the selected row.
    editor.setEditor (text, item, 1);
    // Assign focus to the text control
    text.setText( item.getText(1) );
    text.setFocus ();
   
    //Listener for editor
    text.addKeyListener(new KeyListener() {
      public void keyPressed(KeyEvent e) {
        int escPressed=0;
        switch (e.character){
          case SWT.CR: escPressed=1;break;
        }
        if (escPressed == 1){
          lines[1] = item.getText(0);
          lines[2] = text.getText();
          //System.out.println(lines[1] + " | " + lines[2]);
          epiMaker = new EpiMaker();
          epiMaker.commentWriter(pluginInterface, lines);
            Control oldEditor = editor.getEditor();
          if (oldEditor != null)
          {
            oldEditor.dispose();
          }
          if (!item.isDisposed())
          item.setText(1, lines[2])
         
       
        }
      }
      public void keyReleased (KeyEvent e) {

      }
    });
   
    //Focus Listener for Editor
    text.addFocusListener(new FocusAdapter() {
      public void focusLost(FocusEvent e) {
       
        lines[1] = item.getText(0);
        lines[2] = text.getText();
        //System.out.println(lines[1] + " | " + lines[2]);
        epiMaker = new EpiMaker();
        epiMaker.commentWriter(pluginInterface, lines);
          Control oldEditor = editor.getEditor();
        if (oldEditor != null)
        {
          oldEditor.dispose();
        }
        if (!item.isDisposed())
        item.setText(1, lines[2])
      }
    });
   
}
View Full Code Here

TOP

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

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.