Examples of ITreeSelection


Examples of org.eclipse.jface.viewers.ITreeSelection

  public TreeViewer getCategoryTree() {
    return categoryTree;
  }
 
  public String getCategoryID(){
    ITreeSelection selection = (ITreeSelection)categoryTree.getSelection();
    Object firstElement = selection.getFirstElement();
   
    if (firstElement instanceof Library) {
      Library lib = (Library) firstElement;
      return lib.getID();
     
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

   */
  public boolean performFinish() {
    logger.debug("Performing the finish");
   
    //Get the library we will submit to (its a category alright!)
    ITreeSelection selection = (ITreeSelection)categoryPage.getCategoryTree().getSelection();
   
   
    Object firstElement = selection.getFirstElement();
    if (firstElement instanceof Library) {
      //Library library = (Library) firstElement;
     
      //Get all the values
      String username = descriptionPage.getUserName();
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    setImageDescriptor(BeansGraphImages.DESC_OBJS_BEANS_GPRAH);
  }

  public boolean isEnabled(IStructuredSelection selection) {
    if (selection instanceof ITreeSelection) {
      ITreeSelection tSelection = (ITreeSelection) selection;
      if (tSelection.size() == 1) {
        Object tElement = tSelection.getFirstElement();
        IResourceModelElement rElement = null;
        if (tElement instanceof IResourceModelElement) {
          if (tElement instanceof IBeansConfig || tElement instanceof IBeansConfigSet
              || tElement instanceof IBeansComponent || tElement instanceof IBean) {
            rElement = (IResourceModelElement) tElement;
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

  }

  @Override
  public boolean isEnabled(IStructuredSelection selection) {
    if (selection instanceof ITreeSelection) {
      ITreeSelection tSelection = (ITreeSelection) selection;
      if (tSelection.size() == 1) {
        Object tElement = tSelection.getFirstElement();
        IResourceModelElement rElement = null;
        if (tElement instanceof IResourceModelElement) {
          if (tElement instanceof IBeansConfig || tElement instanceof IBeansConfigSet
              || tElement instanceof IBeansComponent || tElement instanceof IBean) {
            rElement = (IResourceModelElement) tElement;
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

  @SuppressWarnings({ "unchecked", "rawtypes" })
  private IWorkingSet[] getSelectedWorkingSet(IStructuredSelection selection) {
    if (!(selection instanceof ITreeSelection))
      return EMPTY_WORKING_SET_ARRAY;

    ITreeSelection treeSelection = (ITreeSelection) selection;
    if (treeSelection.isEmpty())
      return EMPTY_WORKING_SET_ARRAY;

    List elements = treeSelection.toList();
    if (elements.size() == 1) {
      Object element = elements.get(0);
      TreePath[] paths = treeSelection.getPathsFor(element);
      if (paths.length != 1)
        return EMPTY_WORKING_SET_ARRAY;

      TreePath path = paths[0];
      if (path.getSegmentCount() == 0)
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

    }

  @Override
  public boolean isEnabled(IStructuredSelection selection) {
    if (selection instanceof ITreeSelection) {
      ITreeSelection tSelection = (ITreeSelection) selection;
      if (tSelection.size() == 1) {
        Object tElement = tSelection.getFirstElement();
        IModelElement element = null;
        if (tElement instanceof IModelElement) {
          element = (IModelElement) tElement;
        }
        else if (tElement instanceof IFile) {
          if (BeansUIPlugin.SPRING_EXPLORER_CONTENT_PROVIDER_ID
              .equals(getActionSite().getExtensionId())) {
            element = BeansCorePlugin.getModel().getConfig(
                (IFile) tElement);
          }
        } else if (tElement instanceof ZipEntryStorage) {
          element = BeansModelUtils
              .getConfig((ZipEntryStorage) tElement);
        }
        if (element != null) {
          if (element instanceof IResourceModelElement) {
            project = ((IResourceModelElement) element).getElementResource().getProject();
          }
          else {
            project = BeansModelUtils.getProject(element).getProject();
          }
          block = getProjectPropertyPageBlock(
              tSelection.getPaths()[0]);
          modelElement = element;
          return true;
        }
      }
    }
View Full Code Here

Examples of org.eclipse.jface.viewers.ITreeSelection

  }

  @Override
  public boolean isEnabled(IStructuredSelection selection) {
    if (selection instanceof ITreeSelection) {
      ITreeSelection tSelection = (ITreeSelection) selection;
      if (tSelection.size() == 1) {
        Object tElement = tSelection.getFirstElement();
        if (tElement instanceof ISpringProject) {
          project = ((ISpringProject) tElement).getProject();
          return true;
        }
      }
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.