Examples of ITreeSelection


Examples of org.eclipse.jface.viewers.ITreeSelection

        MenuManager menuMgr = new MenuManager("#PopupMenu");
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(new IMenuListener() {
            public void menuAboutToShow(IMenuManager manager)
            {
                ITreeSelection sel = (ITreeSelection)viewer.getSelection();
                CampaignView.this.fillContextMenu(manager, sel.getFirstElement());
            }
        });
        Menu menu = menuMgr.createContextMenu(viewer.getControl());
        viewer.getControl().setMenu(menu);
        getSite().registerContextMenu(menuMgr, viewer);
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

        MenuManager menuMgr = new MenuManager("#PopupMenu");
        menuMgr.setRemoveAllWhenShown(true);
        menuMgr.addMenuListener(new IMenuListener() {
            public void menuAboutToShow(IMenuManager manager)
            {
                ITreeSelection sel = (ITreeSelection)viewer.getSelection();
                logger.trace("sel: " + sel);

                if(sel != null)
                {
                    logger.debug("filling context menu");
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   * the selection is not a server)
   *
   * @return the currently selected server entry
   */
  public AbstractHadoopCluster getSelectedServer() {
    ITreeSelection selection = (ITreeSelection) viewer.getSelection();
    Object first = selection.getFirstElement();
    if (first instanceof AbstractHadoopCluster) {
      return (AbstractHadoopCluster) first;
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

        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);
            }
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    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();
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    ISelectionService selectionService = window.getSelectionService();
    ISelection selection = selectionService.getSelection();
   
    if (selection instanceof ITreeSelection && (((ITreeSelection) selection).getFirstElement() instanceof IFile)){
      ITreeSelection treeSelection = (ITreeSelection)selection;
      IFile comp = (IFile) treeSelection.getFirstElement();
      CheckoutJob runner = new CheckoutJob(comp);
      runner.setPriority(Job.INTERACTIVE);
      runner.schedule();
    }
   
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    ISelectionService selectionService = window.getSelectionService();
    ISelection selection = selectionService.getSelection();
   
    if (selection instanceof ITreeSelection && (((ITreeSelection) selection).getFirstElement() instanceof IFolder)){
      ITreeSelection treeSelection = (ITreeSelection)selection;
      IFolder planFolder = (IFolder) treeSelection.getFirstElement();
      RunJob runner = new RunJob(planFolder);
      runner.setPriority(Job.INTERACTIVE);
      runner.schedule();
    }
   
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    sashForm.setSashWidth(5);
   
    serverTreeViewer = new TreeViewer(sashForm, SWT.BORDER);
    serverTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        ITreeSelection selection = (ITreeSelection) event.getSelection();
        ClusterCoordinates coordinates = (ClusterCoordinates) selection.getFirstElement();
        currentDB = coordinates;
        if (viewer != null && currentDB != null)
          viewer.setInput(currentDB.getStats());
      }
    });
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    String targetType = "";
    if (selection instanceof ITextSelection){
      targetType = ((ITextSelection)selection).getText();
     
    } if (selection instanceof ITreeSelection){
      ITreeSelection treeSelection = (ITreeSelection)selection;
      if (treeSelection.getFirstElement() != null)
        targetType = treeSelection.getFirstElement().toString();
     
    }
   

    TypeSelectionDialog dialog = new TypeSelectionDialog(window.getShell(), true);
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

public class StandardizeTabsSpacesObjectAction implements IObjectActionDelegate {

    public void run(IAction action) {
        if (_lastSelection != null && _lastSelection instanceof ITreeSelection) {
            ITreeSelection treeSelection = (ITreeSelection) _lastSelection;
            Iterator<?> iterator = treeSelection.iterator();
            while (iterator.hasNext()) {
                ICompilationUnit compilationUnit = (ICompilationUnit) iterator
                        .next();
                try {
                    IEditorPart editor = EditorUtility.openInEditor(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.