Examples of IWorkspaceRunnable


Examples of org.eclipse.core.resources.IWorkspaceRunnable

    if (domElement!=null && underlying!=null) {
      domElement.setName(string);
      underlying.save();
    }
    if (resource!=null) {
        IWorkspaceRunnable r = new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                    final IPath fileRenamePath = resource.getParent().getFullPath().append(string);
                    resource.move(fileRenamePath, true, monitor);
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

      if (parentSk==SerializationKind.METADATA_FULL) {
          createDomChild(childNodeName, childNodeType);
      } else if (parentSk==SerializationKind.FILE) {
            throw new IllegalStateException("cannot create child of nt:file");
      } else if (childSk==SerializationKind.FOLDER) {
            IWorkspaceRunnable r = new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                    IFolder newFolder = prepareCreateFolderChild(childNodeName);
                    if (parentSk==SerializationKind.METADATA_PARTIAL) {
                        // when the parent is partial and we're creating a folder here,
                        // then we're running into a SLING-3639 type of problem
                        // the way around this is to make a 'pointer' in the 'root'
                        // .content.xml, and have a directory structure leaving to
                        // the new node, together with a .content.xml describing
                        // the type (unless it's a nt:folder that is)
                       
                        // 1) 'pointer' in the 'root .content.xml'
                        createDomChild(childNodeName, null);
                       
                        // 2) directory structure is created above already
                        // 3) new .content.xml is done below
                    }
                    if (!childNodeType.equals("nt:folder")) {
                        createVaultFile(newFolder, ".content.xml", childNodeType);
                    }
                }
            };
         
          try {
              ResourcesPlugin.getWorkspace().run(r, null);
              if (childNodeType.equals("nt:folder") && parentSk==SerializationKind.FOLDER) {
                  // trigger a publish, as folder creation is not propagated to
                  // the SlingLaunchpadBehavior otherwise
                  //TODO: make configurable? Fix in Eclipse/WST?
                  ServerUtil.triggerIncrementalBuild((IFolder)resource, null);
              }
          } catch (CoreException e) {
              Activator.getDefault().getPluginLogger().error("Error creating child "+childNodeName+": "+e, e);
              e.printStackTrace();
              MessageDialog.openError(Display.getDefault().getActiveShell(), "Error creating node", "Error creating child of "+thisNodeType+" with type "+childNodeType+": "+e);
              return;
          }
        } else if ((parentSk == SerializationKind.FOLDER || parentSk == SerializationKind.METADATA_PARTIAL)
                && childSk == SerializationKind.METADATA_FULL) {
            createVaultFile((IFolder) resource, serializationManager.getOsPath(childNodeName) + ".xml", childNodeType);
      } else if (parentSk==SerializationKind.FOLDER && childSk==SerializationKind.METADATA_PARTIAL) {
//          createVaultFile((IFolder)resource, childNodeName+".xml", childNodeType);

            IWorkspaceRunnable r = new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                    IFolder f = (IFolder)resource;
                    IFolder newFolder = null;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

      // then I dont know how to delete
      return;
    }
    parent.children.remove(this);
    if (resource!=null) {
            IWorkspaceRunnable r = new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                    resource.delete(true, monitor);
                    if (dirSibling!=null) {
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

      } else {
          key = String.valueOf(id);
      }
        if ("jcr:primaryType".equals(key)) {
            final String newPrimaryType = String.valueOf(value);
            IWorkspaceRunnable r = new IWorkspaceRunnable() {

                @Override
                public void run(IProgressMonitor monitor) throws CoreException {
                    node.changePrimaryType(newPrimaryType);
                }
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

    protected void createMarker(final IResource res,
                                final String message,
                                final int lineNumber) {
        try {
            IWorkspaceRunnable r = new IWorkspaceRunnable() {
                public void run(IProgressMonitor monitor) throws CoreException {
                    IMarker marker = res
                            .createMarker( IDroolsModelMarker.DROOLS_MODEL_PROBLEM_MARKER );
                    marker.setAttribute( IMarker.MESSAGE,
                                         message );
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

   */
  protected IProject setUpProject(final String name) throws CoreException, IOException {
    URL _workspaceURL = this.getWorkspaceURL();
    this.setUpFile(_workspaceURL, name);
    final IProject project = this.getProject(name);
    final IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
      public void run(final IProgressMonitor monitor) throws CoreException {
        project.create(null);
        project.open(null);
      }
    };
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

  public void create(final URI location, final IProgressMonitor monitor) {
    try {
      IHandle _parent = this.getParent();
      final IWorkspace workspace = ((ErlModel) _parent).getWorkspace();
      workspace.run(
        new IWorkspaceRunnable() {
          public void run(final IProgressMonitor monitor0) {
            try {
              IProgressMonitor _elvis = null;
              if (monitor0 != null) {
                _elvis = monitor0;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

        return ErlDebugConstants.ID_ERLANG_DEBUG_MODEL;
    }

    public void createMarker(final IResource resource, final int lineNumber)
            throws CoreException {
        final IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
            @Override
            public void run(final IProgressMonitor monitor) throws CoreException {
                final IMarker marker = DebugMarkerUtils.createErlangLineBreakpointMarker(
                        resource, lineNumber, getModelIdentifier());
                setMarker(marker);
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

    /**
     * Updates message attributes on the given erlang breakpoints.
     */
    private void updateBreakpointsMessages(final IBreakpoint[] breakpoints) {
        final IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
            @Override
            public void run(final IProgressMonitor monitor) throws CoreException {
                for (final IBreakpoint breakpoint : breakpoints) {
                    if (breakpoint instanceof IErlangBreakpoint) {
                        final IErlangBreakpoint erlangBreakpoint = (IErlangBreakpoint) breakpoint;
View Full Code Here

Examples of org.eclipse.core.resources.IWorkspaceRunnable

     *
     * @see org.eclipse.jface.preference.IPreferencePage#performOk()
     */
    @Override
    public boolean performOk() {
        final IWorkspaceRunnable wr = new IWorkspaceRunnable() {
            @Override
            public void run(final IProgressMonitor monitor) throws CoreException {
                final IErlangBreakpoint breakpoint = getBreakpoint();
                final boolean delOnCancel = breakpoint.getMarker().getAttribute(
                        ATTR_DELETE_ON_CANCEL) != null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.