示例#1
0
  @Override
  public void activate() {
    getWidgetModel()
        .setTabItemHandler(
            new ITabItemHandler() {

              public void addTab(int index, TabItem tabItem) {
                TabEditPart.this.addTab(index, tabItem);
              }

              public void removeTab(int index) {
                TabEditPart.this.removeTab(index);
              }
            });
    super.activate();

    UIBundlingThread.getInstance()
        .addRunnable(
            new Runnable() {
              public void run() {
                // add initial tab
                int j = getTabFigure().getTabAmount();
                while (j < getWidgetModel().getTabsAmount()) {
                  addTab();
                  j++;
                }
              }
            });

    UIBundlingThread.getInstance()
        .addRunnable(
            new Runnable() {
              public void run() {
                int index = getWidgetModel().getActiveTab();
                getTabFigure().setActiveTabIndex(index);
                getWidgetModel()
                    .getChildren()
                    .get(index)
                    .setPropertyValue(AbstractWidgetModel.PROP_VISIBLE, true);
              }
            });
  }
示例#2
0
 @Override
 public void deactivate() {
   getTabFigure().dispose();
   super.deactivate();
 }
示例#3
0
 @Override
 protected void createEditPolicies() {
   super.createEditPolicies();
   installEditPolicy(EditPolicy.CONTAINER_ROLE, null);
   installEditPolicy(EditPolicy.LAYOUT_ROLE, null);
 }