Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IAdaptable


      // if the window does not contain a page, create one
      String perspectiveId = welcomePerspectiveInfos[index]
          .getWelcomePerspectiveId();
      if (page == null) {
        IAdaptable root = wbAdvisor.getDefaultPageInput();
        page = window.openPage(perspectiveId, root);
      } else {
        IPerspectiveRegistry reg = getWorkbench()
            .getPerspectiveRegistry();
        IPerspectiveDescriptor desc = reg
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void run()
    {
        IAdaptable element = null;
        String pageId = null;
        String title = null;

        if ( getSelectedConnections().length == 1 )
        {
View Full Code Here

    if( editor == null )
    {
      return null;
    }

    IAdaptable adaptable = editor.getEditorInput();
    IResource resource = (IResource) adaptable.getAdapter(IResource.class);

    return resource;
  }
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

  /**
   * Action called, when Evaluate expression button is pressed
   */
  private void evaluateExpression()
  {
    IAdaptable a = DebugUITools.getDebugContext();
    StackFrame stackFrame = a != null ? (StackFrame) a.getAdapter(StackFrame.class) : null;
    if (stackFrame != null)
    {
      try
            {
          PerlDebugThread thread = stackFrame.getPerlThread();
View Full Code Here

                }
                if (selection != 0) {
                    if (selection==1) {
                        doNotAskAgain = true;
                    }
                    IAdaptable info = new IAdaptable() {
                        public Object getAdapter(Class adapter) {
                            if (Shell.class.equals(adapter))
                                return view.getSite().getShell();
                            if (String.class.equals(adapter))
                                return "user";
                            return null;
                        }
                    };
                   
                    server.publish(IServer.PUBLISH_CLEAN, modules, info, null);
                }
            }
        };
        cleanAction.setText("Clean Publish...");
        cleanAction.setToolTipText("Clean and Publish...");
        ImageDescriptor cleanAndPublishImageDesc = new DecorationOverlayIcon(
                ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH).createImage(),
                ImageDescriptor.createFromFile(SharedImages.class, "refresh.gif"), IDecoration.BOTTOM_RIGHT);
        cleanAction.setImageDescriptor(cleanAndPublishImageDesc);
        cleanAction.setId("org.apache.sling.ide.eclipse.ui.actions.CleanPublishAction");
        publishAction = new Action("Publish", IAction.AS_PUSH_BUTTON) {
            public void run() {
                if (server==null) {
                    MessageDialog.openInformation(view.getSite().getShell(), "No server selected", "A server must be selected");
                    return;
                }
                IAdaptable info = new IAdaptable() {
                    public Object getAdapter(Class adapter) {
                        if (Shell.class.equals(adapter))
                            return view.getSite().getShell();
                        if (String.class.equals(adapter))
                            return "user";
View Full Code Here

  /**
   * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createContents(Composite parent) {
    IAdaptable element = getElement();
    final IProject p = (IProject) element.getAdapter(IProject.class);
    try {
      this.project = PEXServerPlugin.create(p);
    } catch (CoreException e) {
      PEXServerPlugin.logError(e);
    }
View Full Code Here

        ISourceModule source = (ISourceModule) receiver;
        project = source.getScriptProject().getProject();
      } else if (receiver instanceof IProject) {
        project = (IProject) receiver;
      } else if (receiver instanceof IAdaptable) {
        IAdaptable adaptable = (IAdaptable) receiver;
        project = ((IResource)adaptable.getAdapter(IResource.class)).getProject();
      } else if (receiver instanceof IResource) {
        project = ((IResource) receiver).getProject();
      }
     
      if (project != null && project.hasNature(expectedValue.toString())) {
View Full Code Here

        control.setLayout(new FillLayout());

        text = new Text(control, SWT.READ_ONLY | SWT.MULTI | SWT.H_SCROLL);
        text.setFont(SWTResourceManager.getFont("Courier New", 10, SWT.NONE));

        final IAdaptable element = getElement();
        final IFile file = (IFile) element.getAdapter(IFile.class);
        final IErlModule module = ErlangEngine.getInstance().getModel().findModule(file);
        final String value = ErlangEngine.getInstance().getModelUtilService()
                .getModuleInfo(module);
        text.setText(value);
View Full Code Here

     * @param offset
     * @param length
     */
    private static String makeDebuggerVariableHover(final ITextViewer textViewer,
            final int offset, final int length) {
        final IAdaptable adaptable = DebugUITools.getDebugContext();
        if (adaptable != null) {
            final IStackFrame frame = (IStackFrame) adaptable
                    .getAdapter(IStackFrame.class);
            try {
                if (frame != null && frame.hasVariables()) {
                    String varName = "";
                    try {
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.