Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IStructuredSelection


    treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
    treeViewer.setComparator(new NameSorter());
    treeViewer.addFilter(getFilter());   
    IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
    treeViewer.setInput(workspaceRoot);
    IStructuredSelection preSelection = getPreSelection(_workspaceSelection);
    if (preSelection != null) {
      treeViewer.setSelection(preSelection);
    }
    return treeViewer;
  }
View Full Code Here


    }
  }

  private void initialize() {
    if (_selection instanceof IStructuredSelection) {
      IStructuredSelection treeSel = (IStructuredSelection) _selection;
      Object selectedElement = treeSel.getFirstElement();

      if (selectedElement instanceof IResource) {
        IProject selectedRuntimeProject = ((IResource)selectedElement).getProject();
        try {
          _selectedRuntime = (WGARuntime) selectedRuntimeProject.getNature(WGADesignerPlugin.NATURE_WGA_RUNTIME);
View Full Code Here

  }

 
  public static WGADesign fromSelection(ISelection selection) {
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IProject) {
        IProject project = (IProject) selectedElement;
        try {
          return (WGADesign) project.getNature(WGADesignerPlugin.NATURE_WGA_DESIGN);
        } catch (Exception e) {
View Full Code Here

    return null;
  }

  public static WGARuntime fromSelection(ISelection selection) {
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      IProject project = null;
      if (selectedElement instanceof IProject) {
        project = (IProject) selectedElement;
      } else if (selectedElement instanceof IResource) {
        project = ((IResource) selectedElement).getProject();
View Full Code Here

  public void selectionChanged(IAction action, ISelection selection) {
    action.setEnabled(false);
    if (WGARuntime.fromSelection(selection) == null) {
      if (selection instanceof IStructuredSelection) {
        IStructuredSelection structSelection = (IStructuredSelection) selection;
        Object selectedElement = structSelection.getFirstElement();
        if (selectedElement instanceof IProject) {
          _project = (IProject) selectedElement;
          action.setEnabled(true);
        } else if (selectedElement instanceof IJavaProject) {
          _project = ((IJavaProject) selectedElement).getProject();
View Full Code Here

  }

  public void selectionChanged(IAction action, ISelection selection) {
    action.setEnabled(false);
    if (selection != null && selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IFile) {
        _file = (IFile) selectedElement;
        if (_file.getFileExtension().equals("properties")) {
          IContainer container = _file.getParent();
          if (container.getName().startsWith("labels_")) {
View Full Code Here

  }

  public void selectionChanged(IAction action, ISelection selection) {
    action.setEnabled(false);   
    if (selection != null && selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IFile) {         
        _selectedFile = (IFile) selectedElement;     
        if (_selectedFile.getFileExtension().equalsIgnoreCase("tml")) { 
          if (WGADesignStructureHelper.isDirectAccess(_selectedFile)) {
              _contentStore = determineContentStoreOfFile(_selectedFile);
View Full Code Here

 
  public void selectionChanged(IAction action, ISelection selection) {
    action.setEnabled(false);
    _selectedProject = null;
    if (selection != null && selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();   
        if (selectedElement instanceof IProject || selectedElement instanceof IJavaProject) {
          _selectedProject = (IProject) selectedElement;         
        } else if (selectedElement instanceof IContainer) {
          IContainer container = (IContainer) selectedElement;
          if (container.getParent() instanceof IProject &&
View Full Code Here

  public void init(IWorkbench workbench, IStructuredSelection selection) {
    _designContainer = null;
    // folder based design selected?
    if (selection instanceof IStructuredSelection) {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object selectedElement = structSelection.getFirstElement();
      if (selectedElement instanceof IContainer) {
        IContainer container = (IContainer) selectedElement;

        IFile dirlink = container.getFile(new Path("dirlink.xml"));
        if (dirlink.exists()) {
View Full Code Here

  }


  public void selectionChanged(IAction action, ISelection selection) {
    if (selection instanceof IStructuredSelection)  {
      IStructuredSelection structSelection = (IStructuredSelection) selection;
      Object element = structSelection.getFirstElement();
      if (element instanceof IResource) {
        _resource = (IResource) element;
      } else {
        _resource = null;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.IStructuredSelection

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.