Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.CTabItem


        typeTabFolder = new CTabFolder(parent, SWT.BOTTOM | SWT.BORDER);
        typeTabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

        Composite composite1 = new Composite(typeTabFolder, SWT.NONE);
        composite1.setLayout(new GridLayout());
        CTabItem tabItem1 = new CTabItem(typeTabFolder, SWT.NONE);
        tabItem1.setText(Messages.getString("tab.constructor.relation"));
        tabItem1.setControl(composite1);
       
        {
            SwimlaneElement swimlaneElement = swimlaneElements.get(0);
            Composite composite = new Composite(composite1, SWT.NONE);
            composite.setLayout(new GridLayout());
            swimlaneElement.createGUI(composite);
            swimlaneElement.addElementListener(this);
            for (SwimlaneElement childElement : swimlaneElement.getChildren()) {
                childElement.createGUI(swimlaneElement.getClientArea());
            }
        }
       
        Composite composite2 = new Composite(typeTabFolder, SWT.NONE);
        composite2.setLayout(new GridLayout());
        CTabItem tabItem2 = new CTabItem(typeTabFolder, SWT.NONE);
        tabItem2.setText(Messages.getString("tab.constructor.orgfunction"));
        tabItem2.setControl(composite2);

        orgFunctionsTabFolder = new CTabFolder(composite2, SWT.TOP | SWT.BORDER);
        orgFunctionsTabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));

        for (int i=1; i<swimlaneElements.size(); i++) {
            SwimlaneElement swimlaneElement = swimlaneElements.get(i);
            Composite composite = new Composite(orgFunctionsTabFolder, SWT.NONE);
            composite.setLayout(new GridLayout());
            swimlaneElement.createGUI(composite);
            swimlaneElement.addElementListener(this);
            for (SwimlaneElement childElement : swimlaneElement.getChildren()) {
                childElement.createGUI(swimlaneElement.getClientArea());
            }

            CTabItem tabItem = new CTabItem(orgFunctionsTabFolder, SWT.NONE);
            tabItem.setText(swimlaneElement.getDisplayName());
            tabItem.setControl(composite);
        }

        boolean rel = configuration != null && configuration.indexOf("@") == 0;
        typeTabFolder.setSelection(rel ? 0 : 1);
       
View Full Code Here


  @Override
  public void refresh() {
    for (CharacterPresenter characterPresenter : this.presenter
        .getCharacterPresenters()) {
      CTabItem characterTabItem = new CTabItem(this.container, SWT.NONE);
      characterTabItem.setText(characterPresenter.getCharacterName());
      characterTabItem.setControl(new CharacterView(this.container,
          characterPresenter));

    }

  }
View Full Code Here

      binding2.setRealm(new Realm<String>("All", "10", "100", "500",
          "1000", "10000"));
      binding2.addCommitListener(new ICommitListener() {

        public void commitPerformed(ICommand command) {
          CTabItem selection = viewHolder.getSelection();
          if (selection != null) {
            BaseDataFacade bf = (BaseDataFacade) selection
                .getData();
            try {
              bf.setLimit(Integer.parseInt(limit));
            } catch (NumberFormatException e1) {
              bf.setLimit(-1);
            }
          }
        }
      });
      l.setBinding(binding2);
      l.setLayoutData(GridDataFactory.fillDefaults().hint(50, -1)
          .create());
      ComboEnumeratedValueSelector<IProject> v = new ComboEnumeratedValueSelector<IProject>();
      DisposeBindingListener.linkBindingLifeCycle(b, l);
      binding = new Binding("");
      binding.setRequired(true);

      binding.setName("Project:");
      projects = new Realm<IProject>();
      initProjects(projects);
      binding.setRealm(projects);
      v.setBinding(binding);
      if (projectString != null) {
        for (IProject p : projects) {
          if (p.getName().equals(projectString)) {
            setProject(JavaCore.create(p));
          }
        }
      }
      DisposeBindingListener.linkBindingLifeCycle(binding, v);
      binding.addValueListener(new IValueListener<Object>() {

        public void valueChanged(Object oldValue, Object newValue) {
          IProject pr = null;
          if (newValue instanceof String) {
            pr = ResourcesPlugin.getWorkspace().getRoot()
                .getProject(newValue.toString());
          }
          if (newValue instanceof IProject) {
            pr = (IProject) newValue;
          }
          if (pr != null) {
            IJavaProject create = JavaCore.create(pr);
            if (project == null
                || !create.getElementName().equals(
                    project.getElementName())) {
              setProject(create);
            }
          } else {
            setProject(null);
          }
        }
      });
      binding.setAdapter(ITextLabelProvider.class,
          new ITextLabelProvider() {

            public String getText(Object object) {
              if (object == null) {
                return "";
              }
              IProject p = (IProject) object;
              return p.getName();
            }

            public String getDescription(Object object) {
              return "";
            }
          });
      r.add(l);
      r.add(v);
      r.add(new UniversalUIElement<ToolBar>(ToolBar.class, SWT.NONE) {

        protected ToolBar createControl(Composite conComposite) {
          ToolBarManager tm = new ToolBarManager();

          tm.add(new Action("Add view") { // Add view from development
            // server

            {
              /*
               * ToolBarManager tm = new ToolBarManager(); boolean
               * isLocal =
               * Activator.getDefault().getPreferenceStore()
               * .getDefaultBoolean("CONNECTION_MODE");
               */

              /*
               * if(isLocal){
               * setText("Add view from local server");
               * setToolTipText("Add view from local server");
               */
              setImageDescriptor(Activator
                  .imageDescriptorFromPlugin(
                      Activator.PLUGIN_ID,
                      "/icons/exec_view_obj.gif"));
              // setT
              /*
               * }else{
               * setText("Add view from production server");
               * setToolTipText
               * ("Add view from production server");
               *
               * setImageDescriptor(Activator
               * .imageDescriptorFromPlugin( Activator.PLUGIN_ID,
               * "/icons/locale.png"));
               *
               * }
               */
            }

            public void run() {
              boolean isLocal = isDebug();
              if (isLocal) {
                addView(true);
              } else {
                addView(false);
              }
            }

          });
          /*
           * tm.add(new Action("Add view from production server") {
           *
           * { setImageDescriptor(Activator
           * .imageDescriptorFromPlugin( Activator.PLUGIN_ID,
           * "/icons/locale.png")); }
           *
           * public void run() { addView(false); }
           *
           * });
           */
          return tm.createControl(conComposite);
        }

      });
      viewHolder.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
          CTabItem selection = viewHolder.getSelection();
          // BaseDataFacade bf = (BaseDataFacade) selection.getData();
          BlobStoreDataFacade bf = (BlobStoreDataFacade) selection
              .getData();
          try {
            bf.setLimit(Integer.parseInt(limit));
          } catch (NumberFormatException e1) {
            bf.setLimit(-1);
          }
          tableUi.setFacade(bf);
          String text = bf.getStatus();
          statLabel.setText(text);
          status.layout(true);
        }

        public void widgetDefaultSelected(SelectionEvent e) {

        }
      });
      status = new Composite(viewHolder, SWT.NONE);
      GridLayout layout3 = new GridLayout();
      layout3.marginHeight = 2;
      status.setLayout(layout3);
      statLabel = new Label(status, SWT.RIGHT);
      statLabel.setText("Status");
      statLabel.setLayoutData(GridDataFactory.fillDefaults()
          .align(GridData.END, GridData.CENTER).grab(true, false)
          .create());
      statLabel.setForeground(Display.getCurrent().getSystemColor(
          SWT.COLOR_LIST_SELECTION));
      viewHolder.setTopRight(status, SWT.FILL);
      viewHolder.addCTabFolder2Listener(new CTabFolder2Listener() {

        public void showList(CTabFolderEvent event) {
        }

        public void restore(CTabFolderEvent event) {

        }

        public void minimize(CTabFolderEvent event) {

        }

        public void maximize(CTabFolderEvent event) {

        }

        public void close(CTabFolderEvent event) {
          CTabItem widget = (CTabItem) event.item;
          widget.getControl().dispose();
          if (viewHolder.getItemCount() == 1) {
            pageBook.showPage(lm);
            for (IContributionItem i : toolBarManager.getItems()) {
              ActionContributionItem b = (ActionContributionItem) i;
              b.getAction().setEnabled(false);
View Full Code Here

      if (d.getPort() == -1) {
        return;
      }
    }

    final CTabItem cTabItem = new CTabItem(viewHolder, SWT.CLOSE);
    cTabItem.setText("BlobStorage" + " (" + project.getElementName() + ")");
    cTabItem.setShowClose(true);

    Composite owner = new Composite(viewHolder, SWT.NONE);
    owner.setLayout(new FillLayout());
    for (IContributionItem i : toolBarManager.getItems()) {
      if (i instanceof ActionContributionItem) {
        ActionContributionItem b = (ActionContributionItem) i;
        b.getAction().setEnabled(true);
      }
    }

    BaseViewer bd = new BaseViewer(dAction, tableUi, project.getProject(),
        "");
    bd.createControl(owner);
    final BlobStoreDataFacade facade = new BlobStoreDataFacade("", project,
        isDebug(), bd.getRefreshCallback(), bd.getSingleCallback());
    try {
      int parseInt = Integer.parseInt(limit);
      facade.setLimit(parseInt);
    } catch (NumberFormatException e) {

    }
    facade.setStatusCallback(new IStatusCallback() {

      public void statusChanged(final String newStatus) {
        Display.getDefault().asyncExec(new Runnable() {

          public void run() {
            if (viewHolder.getSelection() == cTabItem) {

              statLabel.setText(newStatus);
              status.layout(true, true);
            }
          }
        });
      }
    });
    bd.setDataFacade(facade);
    cTabItem.setData(facade);
    cTabItem.setControl(owner);
    cTabItem.setImage(debug ? DataViewPart.debug : production);
    viewHolder.setSelection(cTabItem);
    tableUi.setFacade(facade);
    pageBook.showPage(viewHolder);
  }
View Full Code Here

      binding2.setRealm(new Realm<String>("All", "10", "100", "500",
          "1000", "10000"));
      binding2.addCommitListener(new ICommitListener() {

        public void commitPerformed(ICommand command) {
          CTabItem selection = viewHolder.getSelection();
          if (selection != null) {
            BaseDataFacade bf = (BaseDataFacade) selection
                .getData();
            try {
              bf.setLimit(Integer.parseInt(limit));
            } catch (NumberFormatException e1) {
              bf.setLimit(-1);
            }
          }
        }
      });
      l.setBinding(binding2);
      l.setLayoutData(GridDataFactory.fillDefaults().hint(50, -1)
          .create());
      ComboEnumeratedValueSelector<IProject> v = new ComboEnumeratedValueSelector<IProject>();
      DisposeBindingListener.linkBindingLifeCycle(b, l);
      binding = new Binding("");
      binding.setRequired(true);

      binding.setName("Project:");
      projects = new Realm<IProject>();
      initProjects(projects);
      binding.setRealm(projects);
      v.setBinding(binding);
      if (projectString != null) {
        for (IProject p : projects) {
          if (p.getName().equals(projectString)) {
            setProject(JavaCore.create(p));
          }
        }
      }
      DisposeBindingListener.linkBindingLifeCycle(binding, v);
      binding.addValueListener(new IValueListener<Object>() {

        public void valueChanged(Object oldValue, Object newValue) {
          IProject pr = null;
          if (newValue instanceof String) {
            pr = ResourcesPlugin.getWorkspace().getRoot()
                .getProject(newValue.toString());
          }
          if (newValue instanceof IProject) {
            pr = (IProject) newValue;
          }
          if (pr != null) {
            IJavaProject create = JavaCore.create(pr);
            if (project == null
                || !create.getElementName().equals(
                    project.getElementName())) {
              setProject(create);
            }
          } else {
            setProject(null);
          }
        }
      });
      binding.setAdapter(ITextLabelProvider.class,
          new ITextLabelProvider() {

            public String getText(Object object) {
              if (object == null) {
                return "";
              }
              IProject p = (IProject) object;
              return p.getName();
            }

            public String getDescription(Object object) {
              return "";
            }
          });
      r.add(l);
      r.add(v);
      r.add(new UniversalUIElement<ToolBar>(ToolBar.class, SWT.NONE) {

        protected ToolBar createControl(Composite conComposite) {
          ToolBarManager tm = new ToolBarManager();

          tm.add(new Action("Add view") { // Add view from development
            // server

            {
              /*
               * ToolBarManager tm = new ToolBarManager(); boolean
               * isLocal =
               * Activator.getDefault().getPreferenceStore()
               * .getDefaultBoolean("CONNECTION_MODE");
               */

              /*
               * if(isLocal){
               * setText("Add view from local server");
               * setToolTipText("Add view from local server");
               */
              setImageDescriptor(Activator
                  .imageDescriptorFromPlugin(
                      Activator.PLUGIN_ID,
                      "/icons/exec_view_obj.gif"));
              // setT
              /*
               * }else{
               * setText("Add view from production server");
               * setToolTipText
               * ("Add view from production server");
               *
               * setImageDescriptor(Activator
               * .imageDescriptorFromPlugin( Activator.PLUGIN_ID,
               * "/icons/locale.png"));
               *
               * }
               */
            }

            public void run() {
              boolean isLocal = isDebug();
              if (isLocal) {
                addView(true);
              } else {
                addView(false);
              }
            }

          });
          /*
           * tm.add(new Action("Add view from production server") {
           *
           * { setImageDescriptor(Activator
           * .imageDescriptorFromPlugin( Activator.PLUGIN_ID,
           * "/icons/locale.png")); }
           *
           * public void run() { addView(false); }
           *
           * });
           */
          return tm.createControl(conComposite);
        }

      });
      viewHolder.addSelectionListener(new SelectionListener() {

        public void widgetSelected(SelectionEvent e) {
          CTabItem selection = viewHolder.getSelection();
          BaseDataFacade bf = (BaseDataFacade) selection.getData();
          try {
            bf.setLimit(Integer.parseInt(limit));
          } catch (NumberFormatException e1) {
            bf.setLimit(-1);
          }
          tableUi.setFacade(bf);
          String text = bf.getStatus();
          statLabel.setText(text);
          status.layout(true);
        }

        public void widgetDefaultSelected(SelectionEvent e) {

        }
      });
      status = new Composite(viewHolder, SWT.NONE);
      GridLayout layout3 = new GridLayout();
      layout3.marginHeight = 2;
      status.setLayout(layout3);
      statLabel = new Label(status, SWT.RIGHT);
      statLabel.setText("Status");
      statLabel.setLayoutData(GridDataFactory.fillDefaults()
          .align(GridData.END, GridData.CENTER).grab(true, false)
          .create());
      statLabel.setForeground(Display.getCurrent().getSystemColor(
          SWT.COLOR_LIST_SELECTION));
      viewHolder.setTopRight(status, SWT.FILL);
      viewHolder.addCTabFolder2Listener(new CTabFolder2Listener() {

        public void showList(CTabFolderEvent event) {
        }

        public void restore(CTabFolderEvent event) {

        }

        public void minimize(CTabFolderEvent event) {

        }

        public void maximize(CTabFolderEvent event) {

        }

        public void close(CTabFolderEvent event) {
          CTabItem widget = (CTabItem) event.item;
          if (widget != null && !widget.isDisposed()) {
            Control control = widget.getControl();
            if (!control.isDisposed()) {
              control.dispose();
            }
          }
          if (viewHolder.getItemCount() < 1) { // == 1 ??
View Full Code Here

      if (d.getPort() == -1) {
        return;
      }
    }

    final CTabItem cTabItem = new CTabItem(viewHolder, SWT.CLOSE);
    StringBuilder title = new StringBuilder();
    title.append(name);
    title.append(" (" + project.getElementName());
    title.append(")");
    cTabItem.setText(title.toString());
    cTabItem.setShowClose(true);

    Composite owner = new Composite(viewHolder, SWT.NONE);
    owner.setLayout(new FillLayout());
    for (IContributionItem i : toolBarManager.getItems()) {
      if (i instanceof ActionContributionItem) {
        ActionContributionItem b = (ActionContributionItem) i;
        b.getAction().setEnabled(true);
      }
    }

    BaseViewer bd = new BaseViewer(dAction, tableUi, project.getProject(),
        name);
    bd.createControl(owner);
    final BaseDataFacade facade = new BaseDataFacade(name, project, this,
        debug, bd.getRefreshCallback(), bd.getSingleCallback());
    try {
      int parseInt = Integer.parseInt(limit);
      facade.setLimit(parseInt);
    } catch (NumberFormatException e) {

    }
    facade.setStatusCallback(new IStatusCallback() {

      public void statusChanged(final String newStatus) {
        Display.getDefault().asyncExec(new Runnable() {

          public void run() {
            if (viewHolder.getSelection() == cTabItem) {

              statLabel.setText(newStatus);
              status.layout(true, true);
            }
          }
        });
      }
    });
    bd.setDataFacade(facade);
    cTabItem.setData(facade);
    cTabItem.setControl(owner);
    cTabItem.setImage(debug ? DataViewPart.debug : production);
    final String nnm = name;
    facade.addChangeNamespaceListener(new IChangeNamespaceListener() {

      public void handleChanging(String namespace) {
        StringBuilder title = new StringBuilder();
        title.append(nnm);
        title.append(" (" + project.getElementName());
        String nsp = tableUi.facade.namespace;
        if (nsp != null && nsp.length() != 0) {
          title.append(":" + nsp);
        }
        title.append(")");
        cTabItem.setText(title.toString());

      }
    });
    viewHolder.setSelection(cTabItem);
    tableUi.setFacade(facade);
View Full Code Here

         * global MUCSession. Therefore we need to correctly validate the
         * MUCSession's state when this ChatView is reopened.
         */
        if (this.joinedSession()) {
            this.attachToMUCSession(mucManager.getMUCSession());
            chatRoom1 = new CTabItem(chatRooms, SWT.NONE);
            chatRoom1.setText(Messages.ChatRoomsComposite_roundtable);
            chatRoom1.setImage(chatViewImage);
            chatRoom1.setControl(chatControl);
            chatRooms.setSelection(0);
            hideExplanation();
View Full Code Here

     @param index The index of the item.
     *  @param control The control for the item.
     *  @return The item created in the tab folder.
     */
    private CTabItem _createItem(int index, Control control) {
        CTabItem item = new CTabItem(_container, SWT.NONE, index);
        item.setControl(control);
        return item;
    }
View Full Code Here

        composite.setLayout(new FillLayout());

        _createItem(pageIndex, composite);
        _setupPreviewPage();

        CTabItem item = _container.getItem(pageIndex);
        item.setText("Preview");
        item.setToolTipText("Preview for refactored Java source "
                + "(a build might be necessary to get the accurate result)");
    }
View Full Code Here

        composite.setLayout(new FillLayout());

        //super.createPartControl(composite);
        _editor = this;

        CTabItem item = _createItem(pageIndex, composite);
        item.setText("Raw");
        item.setToolTipText("Editor for raw Java source file");
    }
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.