Package org.eclipse.ui.ide.undo

Examples of org.eclipse.ui.ide.undo.CreateFileOperation


        switch (configType) {
        case REBAR:
        case EMAKE:
            final IFile cfg = newProjectHandle.getFile(configType.getConfigName());
            final String contents = getConfigContent(info, configType);
            final CreateFileOperation fop = new CreateFileOperation(cfg, null,
                    // TODO real encoding?
                    new ByteArrayInputStream(contents.getBytes(Charsets.ISO_8859_1)),
                    "creating file " + cfg.getName());
            fop.execute(monitor, notifier);
            break;
        case INTERNAL:
            break;
        default:
            break;
View Full Code Here


    {
      public void run(IProgressMonitor monitor)
      {
        URI linkTargetPath = null;

        CreateFileOperation op = new CreateFileOperation(newFileHandle, linkTargetPath, initialContents, IDEWorkbenchMessages.WizardNewFileCreationPage_title);
        try
        {
          // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
          // directly execute the operation so that the undo state is
          // not preserved. Making this undoable resulted in too many
          // accidental file deletions.
          op.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
        } catch (final ExecutionException e)
        {
          getContainer().getShell().getDisplay().syncExec(new Runnable()
          {
            public void run()
View Full Code Here

      IPath newFilePath = getTypePath(projectHandle, packName, typeName);
      IFile newFileHandle = IDEWorkbenchPlugin.getPluginWorkspace()
          .getRoot().getFile(newFilePath);
      InputStream initialContents = getEntryPointInitialContents(projectHandle, packName, typeName);

      CreateFileOperation op = new CreateFileOperation(newFileHandle,
          null, initialContents,
          IDEWorkbenchMessages.WizardNewFileCreationPage_title);
      PlatformUI.getWorkbench().getOperationSupport()
          .getOperationHistory().execute(op, monitor,
              WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
View Full Code Here

      IPath newFilePath = getFilePath(projectHandle, packageName, fileName);
      IFile newFileHandle
        = IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getFile(newFilePath);
      InputStream initialContents = getInitialContents(packageName, fileName);

        CreateFileOperation op
          = new CreateFileOperation(newFileHandle, null,
            initialContents,
            IDEWorkbenchMessages.WizardNewFileCreationPage_title);
        try {
            PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(
              op, monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
View Full Code Here

      IPath newFilePath = getHostPageFilePath(projectHandle);
      IFile newFileHandle
        = IDEWorkbenchPlugin.getPluginWorkspace().getRoot().getFile(newFilePath);
      InputStream initialContents = getHostPageInitialContents(moduleName);

        CreateFileOperation op
          = new CreateFileOperation(newFileHandle, null,
            initialContents,
            IDEWorkbenchMessages.WizardNewFileCreationPage_title);
        try {
            PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().execute(
              op, monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
View Full Code Here

      IPath newFilePath = getModulePath(projectHandle, packName, moduleName);
      IFile newFileHandle = IDEWorkbenchPlugin.getPluginWorkspace()
          .getRoot().getFile(newFilePath);
      InputStream initialContents = getModuleInitialContents(projectHandle, moduleName, entryPoint);

      CreateFileOperation op = new CreateFileOperation(newFileHandle,
          null, initialContents,
          IDEWorkbenchMessages.WizardNewFileCreationPage_title);
      PlatformUI.getWorkbench().getOperationSupport()
          .getOperationHistory().execute(op, monitor,
              WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
View Full Code Here

  }
 
  private void createFile(final IFile path) {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        CreateFileOperation op = new CreateFileOperation(path,
            null, null,
            "Creating diagram file");
        try {
          // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
          // directly execute the operation so that the undo state is
          // not preserved.  Making this undoable resulted in too many
          // accidental file deletions.
          op.execute(monitor, WorkspaceUndoUtil
              .getUIInfoAdapter(getShell()));
        } catch (final ExecutionException e) {
         
          ErrorDialog.openError(getContainer().getShell(),
              "Failed to create DISPEL diagram file",
View Full Code Here

   */
  private void createFile(final IFile path,
      TransactionalEditingDomain domain) {
    Runnable op = new Runnable() {
      public void run() {
        CreateFileOperation op = new CreateFileOperation(path,
            null, null,
            "Creating diagram file");
        try {
          // see bug
          // https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
          // directly execute the operation so that the undo state is
          // not preserved.  Making this undoable resulted in too many
          // accidental file deletions.
     
          op.execute(new NullProgressMonitor(), WorkspaceUndoUtil
              .getUIInfoAdapter(getShell()));
        } catch (final ExecutionException e) {
         
          MessageDialog.openError(getShell(),
              "Failed to create DISPEL diagram file",
View Full Code Here

   * @param path Path of file to create.
   */
  private void createFile(final IFile path) {
    IRunnableWithProgress op = new IRunnableWithProgress() {
      public void run(IProgressMonitor monitor) {
        CreateFileOperation op = new CreateFileOperation(path,
            null, null,
            "Creating diagram file");
        try {
          // see bug
          // https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
          // directly execute the operation so that the undo state is
          // not preserved.  Making this undoable resulted in too many
          // accidental file deletions.
          op.execute(monitor, WorkspaceUndoUtil
              .getUIInfoAdapter(getShell()));
        } catch (final ExecutionException e) {
         
          ErrorDialog.openError(getContainer().getShell(),
              "Failed to create DISPEL diagram file",
View Full Code Here

   * @param domain Used to run operation
   */
  private void createFile(final IFile path, TransactionalEditingDomain domain) {
    Runnable op = new Runnable() {
      public void run() {
        CreateFileOperation op = new CreateFileOperation(path,
            null, null,
            "Creating diagram file");
        try {
          // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=219901
          // directly execute the operation so that the undo state is
          // not preserved.  Making this undoable resulted in too many
          // accidental file deletions.
     
          op.execute(new NullProgressMonitor(), WorkspaceUndoUtil
              .getUIInfoAdapter(getShell()));
        } catch (final ExecutionException e) {
         
          MessageDialog.openError(getShell(),
              "Failed to create DISPEL diagram file",
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ide.undo.CreateFileOperation

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.