Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IAdaptable


  }
 
  private boolean hasMDHeader() {
    boolean hasMDHeader = false;
    try {
      IAdaptable element = getElement();
      if (element instanceof IFile) {
        IFile tmlFile = (IFile) getElement();
        TMLDocumentProvider provider = new TMLDocumentProvider();   
        IFileEditorInput input = new FileEditorInput(tmlFile);     
        provider.connect(input);
View Full Code Here


  }

  @Override
  public Model getModel() {
    if (_model == null) {
      IAdaptable element = getElement();
      if (element instanceof IFile) {
        IFile tmlFile = (IFile) getElement()
        _model = new TMLFileMetadataModel(tmlFile);
      }
    }
View Full Code Here

   
    return composite;
  }

  private IContainer getDesignRoot() {
    IAdaptable element = getElement();
    if (element instanceof IContainer) {
      IContainer container = (IContainer) getElement();
      if (WGADesignStructureHelper.isDesignFolder(container)) {
        return container;
      }
View Full Code Here

                Object next = elements.next();
                if (next instanceof IMember) {
                    resources.add(next);
                    continue;
                } else if (next instanceof IAdaptable) {
                    IAdaptable a = (IAdaptable) next;
                    Object adapter = a.getAdapter(IMember.class);
                    if (adapter instanceof IMember) {
                        resources.add(adapter);
                        continue;
                    }
                }
View Full Code Here

                    continue;
                } if (next instanceof IJavaElement) {
                    resources.add(next);
                    continue;
                } else if (next instanceof IAdaptable) {
                    IAdaptable a = (IAdaptable) next;
                    Object adapter = a.getAdapter(IFile.class);
                    if (adapter instanceof IFile) {
                        resources.add(JavaCore.create((IFile)adapter));
                        continue;
                    }
                    adapter = a.getAdapter(ICompilationUnit.class);
                    if (adapter instanceof ICompilationUnit) {
                        resources.add(adapter);
                        continue;
                    }

                    adapter = a.getAdapter(IClassFile.class);
                    if (adapter instanceof IClassFile) {
                        resources.add(adapter);
                        continue;
                    }
                }
View Full Code Here

            launchProject(project, mode);
        } else if (selected instanceof IFile && ((IFile) selected).getName().endsWith(LaunchConstants.EXT_BNDRUN)) {
            IFile bndRunFile = (IFile) selected;
            launchBndRun(bndRunFile, mode);
        } else if (selected instanceof IAdaptable) {
            IAdaptable adaptable = (IAdaptable) selected;
            IJavaElement javaElement = (IJavaElement) adaptable.getAdapter(IJavaElement.class);
            if (javaElement != null) {
                launchJavaElement(javaElement, mode);
            } else {
                IResource resource = (IResource) adaptable.getAdapter(IResource.class);
                if (resource != null && resource != selected)
                    launchSelectedObject(resource, mode);
            }
        }
    }
View Full Code Here

        return container;
    }

    IProject getProject() {
        IAdaptable elem = getElement();
        if (elem instanceof IProject)
            return (IProject) elem;

        IProject project = (IProject) elem.getAdapter(IProject.class);
        if (project != null)
            return project;

        throw new IllegalArgumentException("Target element does not adapt to IProject");
    }
View Full Code Here

        for (Iterator< ? > iter = structSel.iterator(); iter.hasNext();) {
            Object element = iter.next();
            if (element instanceof IFile)
                files.add(((IFile) element).getLocation().toFile());
            else if (element instanceof IAdaptable) {
                IAdaptable adaptable = (IAdaptable) element;
                IFile ifile = (IFile) adaptable.getAdapter(IFile.class);
                if (ifile != null) {
                    files.add(ifile.getLocation().toFile());
                } else {
                    File file = (File) adaptable.getAdapter(File.class);
                    if (file != null) {
                        files.add(file);
                    }
                }
            }
View Full Code Here

      IPerspectiveDescriptor persp = currentPage.getPerspective();
      String label = ""; //$NON-NLS-1$
      if (persp != null) {
        label = persp.getLabel();
      }
      IAdaptable input = currentPage.getInput();
      if (input != null && !input.equals(wbAdvisor.getDefaultPageInput())) {
        label = currentPage.getLabel();
      }
      if (label != null && !label.equals("")) { //$NON-NLS-1$
        title = NLS.bind(
            IDEWorkbenchMessages.WorkbenchWindow_shellTitle, label,
View Full Code Here

    IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
    IWorkbenchWindow window = configurer.getWindow();
    IEditorPart activeEditor = null;
    IWorkbenchPage currentPage = window.getActivePage();
    IPerspectiveDescriptor persp = null;
    IAdaptable input = null;

    if (currentPage != null) {
      activeEditor = currentPage.getActiveEditor();
      persp = currentPage.getPerspective();
      input = currentPage.getInput();
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IAdaptable

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.