Examples of TreeSelection


Examples of org.eclipse.jface.viewers.TreeSelection

        // rulesTableViewer.refresh(rule, true, true);
        groupRulesTreeViewer.update(ruleWrapper, null);
    }

    protected RuleWrapper getSelectedRule() {
        TreeSelection selection = (TreeSelection) groupRulesTreeViewer.getSelection();
        Object firstElement = selection.getFirstElement();
        if (firstElement instanceof RuleWrapper) {
            RuleWrapper wrapper = (RuleWrapper) firstElement;
            return wrapper;
        }
        return null;
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

        }
        return null;
    }

    protected FeatureTypeStyleWrapper getSelectedFtsw() {
        TreeSelection selection = (TreeSelection) groupRulesTreeViewer.getSelection();
        Object firstElement = selection.getFirstElement();
        if (firstElement instanceof FeatureTypeStyleWrapper) {
            FeatureTypeStyleWrapper wrapper = (FeatureTypeStyleWrapper) firstElement;
            return wrapper;
        }
        return null;
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

                List<TreePath> paths = new ArrayList<TreePath>(exported.size());

                for( IGeoResource resource : exported ) {
                    paths.add(new TreePath(toTreePath(resource).toArray()));
                }
                return new TreeSelection(paths.toArray(new TreePath[paths.size()]));
            }

            private List<IResolve> toTreePath( IGeoResource resource ) {
                IResolve parent;
                try {
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

                }
                if (omsboxTransfer.isSupportedType(event.currentDataType)) {
                    try {
                        Object data = event.data;
                        if (data instanceof TreeSelection) {
                            TreeSelection selection = (TreeSelection) data;
                            Object firstElement = selection.getFirstElement();

                            IGeoResource geoResource = null;
                            if (firstElement instanceof LayerImpl) {
                                LayerImpl layer = (LayerImpl) firstElement;
                                geoResource = layer.getGeoResource();
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

                }
                if (omsboxTransfer.isSupportedType(event.currentDataType)) {
                    try {
                        Object data = event.data;
                        if (data instanceof TreeSelection) {
                            TreeSelection selection = (TreeSelection) data;
                            Object firstElement = selection.getFirstElement();

                            IGeoResource geoResource = null;
                            if (firstElement instanceof LayerImpl) {
                                LayerImpl layer = (LayerImpl) firstElement;
                                geoResource = layer.getGeoResource();
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

  protected void buttonPressed(int buttonId) {
    if (buttonId == NULL_ID) {
      imgFile = null;
      super.okPressed();
    } else if (buttonId == IMPORT_ID) {
      TreeSelection sel = (TreeSelection) view.getSelection();
      if (sel != null && !sel.isEmpty()) {
        Object element = sel.getFirstElement();
        String path = null;
        if (element instanceof IPackageFragmentRoot) {
          path = ((IPackageFragmentRoot) element).getResource().getRawLocation().toFile().getAbsolutePath();
        } else if (element instanceof IPackageFragment) {
          path = ((IPackageFragment) element).getResource().getRawLocation().toFile().getAbsolutePath();
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

      }
    }
    return ctrl;
  }
  private void treeDoubleClicked(MouseEvent e) {
    TreeSelection sel=(TreeSelection) view.getSelection();
    if(sel!=null&&!sel.isEmpty()){
      updateButton(sel.getFirstElement());
      if(getButton(IDialogConstants.OK_ID).isEnabled()){
        buttonPressed(IDialogConstants.OK_ID);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

        buttonPressed(IDialogConstants.OK_ID);
      }
    }
  }
  private void view_selectionChanged(SelectionChangedEvent event) {
    TreeSelection sel = (TreeSelection) event.getSelection();
    Object selected = sel.getFirstElement();
    updateButton(selected);
  }
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

    }
    return ctrl;
  }

  private void view_selectionChanged(SelectionChangedEvent event) {
    TreeSelection sel = (TreeSelection) event.getSelection();
    Object selected = sel.getFirstElement();
    if (selected != null) {
      if (selected instanceof IFile) {
        IFile file = (IFile) selected;
        String name = file.getName();
        name = name.toLowerCase();
View Full Code Here

Examples of org.eclipse.jface.viewers.TreeSelection

    if (part instanceof VisualSwingEditor && !selection.isEmpty() && selection instanceof IStructuredSelection) {
      Object element = ((IStructuredSelection) selection).getFirstElement();
      if (element instanceof WidgetSelection&&!getTreeViewer().getTree().isDisposed()) {
        getTreeViewer().refresh();
        TreePath[] paths = getTreePath((WidgetSelection) element);
        TreeSelection sel = new TreeSelection(paths);
        setSelection(sel);
      }
    }
  }
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.