Package tool.navigator.common

Examples of tool.navigator.common.LabelProvider


          return ((List<ToolClass>)parent).toArray();
        }
        return null;
      }
    });
    treeViewer.setLabelProvider(new LabelProvider(LabelProvider.FULL_PATH)) ;
    treeViewer.setAutoExpandLevel(1);

    return container;
  }
View Full Code Here


 
  public static ToolComponent select(ToolComponent component, ToolComponent initialSelection){
    IProject project  = component.getFile().getProject();
    ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
        Display.getDefault().getActiveShell(),
          new LabelProvider(),
          new SupplierContentProvider(project));
   
      ToolPlan rootPlan = null;
      if (component instanceof ToolServiceObject){
        rootPlan = ((ToolServiceObject)component).getPlan();
View Full Code Here

          }

         
         
        },
        new LabelProvider(),
        "Select suppier plans from list");
        supplierDialog.setInitialSelections(supplierPlans.toArray());
        supplierDialog.setTitle("Supplier Plans");
        int act = supplierDialog.open();
        switch (act){
        case Dialog.OK:
          /*
           * 1. clear the existing suppliers,
           * 2. write the selected ones
           * 3. rewrite the prx file
           */
          Object[] sups = supplierDialog.getResult();
          model.clearSuppliers();
          for (Object elem : sups){
            String name = ((ToolPlan)elem).getToolName();
            model.addSupplierPlan(name);
          }
          model.setDirty(true);
          supplierPlanTreeViewer.setInput(model.getSupplierPlansAsToolPlans());
          break;
        case Dialog.CANCEL:
          break;
        }

      }
    });
    editSuppButton.setBounds(0, 0, 94, 30);
    formToolkit.adapt(editSuppButton, true, true);
    editSuppButton.setText("Edit");
    composite_1.setLayout(new GridLayout(2, false));
   
    supplierPlanTreeViewer = new TreeViewer(composite_1, SWT.BORDER);
    Tree supplierPlanTree = supplierPlanTreeViewer.getTree();
    supplierPlanTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    new Label(composite_1, SWT.NONE);
    new Label(composite_1, SWT.NONE);
    supplierPlanTreeViewer.setContentProvider(new ITreeContentProvider() {
     
      @Override
      public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
       
      }
     
      @Override
      public void dispose() {
       
      }
     
      @Override
      public boolean hasChildren(Object parent) {
        return false;
      }
     
      @Override
      public Object getParent(Object child) {
        return null;
      }
     
      @Override
      public Object[] getElements(Object parent) {
        if (parent instanceof Set<?>){
          return ((Set<?>)parent).toArray();
        }
        return null;
      }
     
      @Override
      public Object[] getChildren(Object parent) {
        return getElements(parent);
      }
    });
    supplierPlanTreeViewer.setLabelProvider(new LabelProvider());
    supplierPlansExpanditem.setHeight(supplierPlansExpanditem.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    if (this.model != null){
      bind();
    }
    m_bindingContext = initDataBindings();
View Full Code Here

    Tree supplierPlanTree = supplierPlanTreeViewer.getTree();
    supplierPlanTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    new Label(composite_1, SWT.NONE);
    new Label(composite_1, SWT.NONE);
    supplierPlanTreeViewer.setContentProvider(new ContentProvider(ContentProvider.SUPPLIERS));
    supplierPlanTreeViewer.setLabelProvider(new LabelProvider());
    supplierPlansExpanditem.setHeight(supplierPlansExpanditem.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
   
    constantsExpanditem = new ExpandItem(expandBar, SWT.NONE);
    constantsExpanditem.setImage(ResourceManager.getPluginImage("Tool", "icons/constant.gif"));
    constantsExpanditem.setText("Constants");
   
    Composite composite_2 = new Composite(expandBar, SWT.NONE);
    constantsExpanditem.setControl(composite_2);
    composite_2.setLayout(new GridLayout(1, false));
   
    constantsTreeViewer = new TreeViewer(composite_2, SWT.BORDER);
    constantsTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
      public void doubleClick(DoubleClickEvent event) {
        ITreeSelection selection = (ITreeSelection)event.getSelection();
        ToolConstant constant = (ToolConstant)selection.getFirstElement();
        ConstantDialog.show(constant);
      }
    });
    constantsTreeViewer.setAutoExpandLevel(1);
    Tree constantsTree = constantsTreeViewer.getTree();
    GridData gd_constantsTree = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    gd_constantsTree.minimumHeight = 300;
    constantsTree.setLayoutData(gd_constantsTree);
    constantsTreeViewer.setContentProvider(new ContentProvider(ContentProvider.CONSTANTS));
    constantsTreeViewer.setLabelProvider(new LabelProvider());
    constantsExpanditem.setHeight(constantsExpanditem.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    if (this.model != null){
      bind();
    }
    m_bindingContext = initDataBindings();
View Full Code Here

              Object oldInput,
              Object newInput) {
            System.out.println("Input changed: old=" + oldInput + ", new=" + newInput);
          }
        });
        listViewer.setLabelProvider(new LabelProvider());
        Composite buttonComposite = new Composite(interfaceComposite, SWT.NONE);
        //buttonComposite.setSize(51, 46);
        buttonComposite.setCapture(true);
        GridLayout gl_buttonComposite = new GridLayout(1, false);
        gl_buttonComposite.verticalSpacing = 0;
        gl_buttonComposite.marginWidth = 0;
        gl_buttonComposite.horizontalSpacing = 0;
        gl_buttonComposite.marginHeight = 0;
        buttonComposite.setLayout(gl_buttonComposite);
       
        addButton = new Button(buttonComposite, SWT.NONE);
        addButton.setBounds(0, 0, 94, 30);
        addButton.setText("Add");
       
        removeButton = new Button(buttonComposite, SWT.NONE);
        removeButton.setBounds(0, 0, 94, 30);
        removeButton.setText("Remove");
       
        tableViewer.setContentProvider(new ArrayContentProvider());
       
        Composite membersComposite = new Composite(parent, SWT.NONE);
        membersComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        membersComposite.setLayout(new GridLayout(1, false));
       
        treeViewer = new TreeViewer(membersComposite, SWT.BORDER);
        treeViewer.addDoubleClickListener(new IDoubleClickListener() {
          public void doubleClick(DoubleClickEvent event) {
            ITreeSelection selection = (ITreeSelection)event.getSelection();
            IWorkbenchWindow window=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            IWorkbenchPage page = window.getActivePage();
            Object element = selection.getFirstElement();
            if (element instanceof IClassComponent){
              OpenClassComponentAction action = new OpenClassComponentAction(page, (IClassComponent)element);
              action.run();
              treeViewer.refresh(element);
            }
          }
        });
        treeViewer.setSorter(new ViewerSorter());
        treeViewer.setAutoExpandLevel(1);
        Tree membersTree = treeViewer.getTree();
        GridData gd_membersTree = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
        gd_membersTree.widthHint = 300;
        membersTree.setLayoutData(gd_membersTree);
        membersTree.setSize(0, 0);
        treeViewer.setLabelProvider(new LabelProvider());
        treeViewer.setContentProvider(new CdfContentProvider());
   
   
   
    if (this.cdf != null){
View Full Code Here

    container.setLayout(new GridLayout(1, false));
   
    TreeViewer treeViewer = new TreeViewer(container, SWT.BORDER);
    Tree tree = treeViewer.getTree();
    tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    treeViewer.setLabelProvider(new LabelProvider());
    treeViewer.setContentProvider(new CdfContentProvider());

    createActions();
    initializeToolBar();
    initializeMenu();
View Full Code Here

TOP

Related Classes of tool.navigator.common.LabelProvider

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.