Package org.vietspider.ui.widget.vtab

Examples of org.vietspider.ui.widget.vtab.IVTabGroup


    VTabGroup group = new VTabGroup(this, name);
    groupsList.add(group);
    group.getPeer().addMouseListener(new MouseAdapter(){
      public void mouseUp(MouseEvent event) {
        Control vControl = (Control)event.widget;
        IVTabGroup grp = getGroupByControl(vControl);
        if(grp == null || grp.isSelected()) return;      
        selectedGroup.setSelected(false);
        grp.setSelected(true);
        selectedGroup = grp;        
        layout();          
      }
    });
    if(selectedGroup != null) return group;
View Full Code Here


    }   
    return true;
  }
 
  public IVTabGroup getGroupByName(String name){
    IVTabGroup group = null;
    for(IVTabGroup ele : groupsList){
      if(ele.getName().trim().equalsIgnoreCase(name)) group = ele;
    }
    if(group == null) group = createGroup(name);
    return group;
View Full Code Here

  public Composite getGroup(String name){   
    return (Composite)(getGroupByName(name).getComposite().getContent())
  }

  public IVTabItem addItem(String aGroup, Control control){
    IVTabGroup group = getGroupByName(aGroup);
    IVTabItem aItem = new VTabItem();
    aItem.setGroup(group);
    aItem.setControl(control);    
    group.addItem(aItem);
    return aItem;
  }
View Full Code Here

  }

  public void setSelectGroup(int idx){
    for( int i=0; i < this.groupsList.size(); i++){
      if( i != idx) continue;
      IVTabGroup group = groupsList.get(i);
      selectedGroup.setSelected(false);
      group.setSelected(true);
      selectedGroup = group;
      layout();
      return;
    }
  }
View Full Code Here

    int left = 0;
   
    int bottom = groupList.size() > 1 ? 95 : 50;
   
    for(int i = 0; i < groupList.size(); i++){
      IVTabGroup group = groupList.get(i);         
      ScrolledComposite groupContainer = group.getComposite();
      Control control = group.getPeer();
      if(group.isSelected()){
        control.setBounds(left, top, barSize.x, titleHeight);
        top += titleHeight - 1;
        int controlBottom = layoutBottomUp(groupList, i, left, barSize.x, barSize.y);
       
        groupContainer.setVisible(true);
        groupContainer.setBounds(left, top, barSize.x, controlBottom - top);
        groupContainer.getContent().setBounds(left, 0, barSize.x - 4, group.getItemList().size()*(barSize.y- bottom));//95
        return;
      }
      control.setBounds(0, top, barSize.x, titleHeight);
      top += titleHeight;
      groupContainer.setVisible(false);
View Full Code Here

 
  protected int layoutBottomUp(List<IVTabGroup> aList, int aPosition, int aLeft, int aWidth, int aHeight){
    int top = aHeight - titleHeight + 5;
    int width = aWidth;
    for(int i = aList.size() - 1; i > aPosition; i--){
      IVTabGroup group = aList.get(i);
      top -= titleHeight;
      Control control = group.getPeer();
      control.setBounds(aLeft, top, width, titleHeight);
      ScrolledComposite groupContainer = group.getComposite();
      groupContainer.setVisible(false);
    }   
    return top;
  }
View Full Code Here

TOP

Related Classes of org.vietspider.ui.widget.vtab.IVTabGroup

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.