Package org.eclipse.ui

Examples of org.eclipse.ui.IPathEditorInput


    {
        File file = null;
        String elementClassName = element.getClass().getName();
        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            IPath path = pei.getPath();
            file = path.toFile();
        }
        else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
            || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here


    public boolean isModifiable( Object element )
    {
        String elementClassName = element.getClass().getName();
        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            File file = pei.getPath().toFile();
            return file.canWrite() || !file.exists(); // Allow to edit new files
        }
        else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
            || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here

     */
    public void init( IEditorSite site, IEditorInput input ) throws PartInitException
    {
        if ( input instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) input;
            IPath path = pei.getPath();
            File javaIoFile = path.toFile();
            long fileLength = javaIoFile.length();
            if ( fileLength > ( 1 * 1024 * 1024 ) )
            {
                MessageDialog.openError( site.getShell(), "LDIF file is too big",
View Full Code Here

        throws CoreException
    {

        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            IPath path = pei.getPath();
            File file = path.toFile();

            try
            {
                file.createNewFile();
View Full Code Here

     */
    public boolean isModifiable( Object element )
    {
        if ( element instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) element;
            File file = pei.getPath().toFile();
            return file.canWrite() || !file.exists(); // Allow to edit new files
        }
        return false;
    }
View Full Code Here

        }

        // create IEdiorInput
        IPath location = new Path( file.getAbsolutePath() );
        ImageDescriptor imageDescriptor = descriptor.getImageDescriptor();
        IPathEditorInput input = new PathEditorInput( location, imageDescriptor );

        // activate editor
        IWorkbenchPage page = workbenchWindow.getActivePage();
        String editorId = descriptor.getId();
        try
View Full Code Here

    this.file = file;
  }

  public boolean equals(Object o) {
    if (o instanceof IPathEditorInput) {
      IPathEditorInput input = (IPathEditorInput) o;
      return getPath().equals(input.getPath());
    }
    return false;
  }
View Full Code Here

      if (ComponentSupport.inPlaceEditorSupported()) {
        result = new EditorReference(this, input, desc);
      }
    } else if (desc.getId().equals(
        IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID)) {
      IPathEditorInput pathInput = getPathEditorInput(input);
      if (pathInput != null) {
        result = openSystemExternalEditor(pathInput.getPath());
      } else {
        throw new PartInitException(
            WorkbenchMessages.EditorManager_systemEditorError);
      }
    } else if (desc.isOpenExternal()) {
View Full Code Here

   */
  private IEditorReference openExternalEditor(final EditorDescriptor desc,
      IEditorInput input) throws PartInitException {
    final CoreException ex[] = new CoreException[1];

    final IPathEditorInput pathInput = getPathEditorInput(input);
    if (pathInput != null && pathInput.getPath() != null) {
      BusyIndicator.showWhile(getDisplay(), new Runnable() {
        public void run() {
          try {
            if (desc.getLauncher() != null) {
              // open using launcher
              Object launcher = WorkbenchPlugin.createExtension(
                  desc.getConfigurationElement(), "launcher"); //$NON-NLS-1$
              ((IEditorLauncher) launcher).open(pathInput
                  .getPath());
            } else {
              // open using command
              ExternalEditor oEditor = new ExternalEditor(
                  pathInput.getPath(), desc);
              oEditor.open();
            }
          } catch (CoreException e) {
            ex[0] = e;
          }
View Full Code Here

    {
        String className = input.getClass().getName();
        File file = null;
        if ( input instanceof IPathEditorInput )
        {
            IPathEditorInput pei = ( IPathEditorInput ) input;
            IPath path = pei.getPath();
            file = path.toFile();
        }
        else if ( className.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
            || className.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
        // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPathEditorInput

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.