Package org.objectstyle.wolips.core.resources

Examples of org.objectstyle.wolips.core.resources.IWOLipsResource


        List list = ((IStructuredSelection) selection).toList();
        for (int i = 0; i < list.size(); i++) {
          Object object = list.get(i);
          if (object instanceof IAdaptable) {
            IWOLipsResource wolipsResource = (IWOLipsResource)((IAdaptable) object).getAdapter(IWOLipsResource.class);
            if (wolipsResource != null) {
              wolipsResource.open();
            }
            else if (object instanceof IFile) {
              WorkbenchUtilities.open((IFile) object);
            }
          }
View Full Code Here


    _labelProvider = labelProvider;
  }

  public Object[] getElements(Object parent) {
    Object actualParent = parent;
    IWOLipsResource wolipsResource = null;
    // MS: If we add the dependency it is a circular dependency, so that
    // sucks ... We'll just do it Reflection-Style.
    if (actualParent != null && actualParent.getClass().getName().equals("org.objectstyle.wolips.components.input.ComponentEditorFileEditorInput")) {
      try {
        actualParent = actualParent.getClass().getMethod("getFile", (Class[]) null).invoke(actualParent, (Object[]) null);
      } catch (Exception e) {
        e.printStackTrace();
      }
      // System.out.println("ViewContentProvider.getElements: " +
      // parent);
    }
    if (actualParent instanceof IFileEditorInput) {
      IFileEditorInput input = (IFileEditorInput) actualParent;
      actualParent = input.getFile();
    }
    if (actualParent instanceof IFile) {
      try {
        // HACK AK: we should use sth more generic here
        if ("java".equals(((IFile)actualParent).getFileExtension())) {
          actualParent = JavaCore.createCompilationUnitFrom((IFile)actualParent);
        }
      } catch (Exception ex) {
        UIPlugin.getDefault().log(ex);
      }
    }
    if (actualParent instanceof IMember) {
      actualParent = ((IMember) actualParent).getCompilationUnit();
    }
    if (actualParent instanceof IAdaptable) {
      wolipsResource = (IWOLipsResource)((IAdaptable)actualParent).getAdapter(IWOLipsResource.class);
      // getViewer().setInput(wolipsResource);
    }
   
    Object[] resultList;
    if (_lastResource != null && wolipsResource != null && _lastResource.equals(wolipsResource)) {
      resultList = _lastResultList;
    }
    else {
      List<IResource> result = new LinkedList<IResource>();
      if (wolipsResource != null) {
        try {
          List<IResource> list = wolipsResource.getRelatedResources();
          result.addAll(list);
 
        } catch (Exception e) {
          UIPlugin.getDefault().log(e);
        }
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.core.resources.IWOLipsResource

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.