/** ** END Listeners *** */ protected void makeFileEditable(IFile aFile) { if (aFile == null) return; aFile.getResourceAttributes().setReadOnly(false); }
@Deprecated @Override public void setReadOnly(boolean readonly) { ResourceAttributes attributes = getResourceAttributes(); if (attributes == null) return; attributes.setReadOnly(readonly); try { setResourceAttributes(attributes); } catch (CoreException e) { //failure is not an option } }
@Deprecated @Override public void setReadOnly(boolean readonly) { ResourceAttributes attributes = getResourceAttributes(); if (attributes == null) return; attributes.setReadOnly(readonly); try { setResourceAttributes(attributes); } catch (CoreException e) { //failure is not an option } }
public static void setWriteable(String path) throws Exception { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path)); ResourceAttributes resourceAttributes = file.getResourceAttributes(); if (resourceAttributes != null) { resourceAttributes.setReadOnly(false); file.setResourceAttributes(resourceAttributes); } } }
public static void setWriteable(String workspacePath) throws Exception { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(workspacePath)); ResourceAttributes resourceAttributes = file.getResourceAttributes(); if (resourceAttributes != null) { resourceAttributes.setReadOnly(false); file.setResourceAttributes(resourceAttributes); } }
public static void setWriteable(String workspacePath) throws Exception { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(workspacePath)); ResourceAttributes resourceAttributes = file.getResourceAttributes(); if (resourceAttributes != null) { resourceAttributes.setReadOnly(false); file.setResourceAttributes(resourceAttributes); } }
@Deprecated @Override public void setReadOnly(boolean readonly) { ResourceAttributes attributes = getResourceAttributes(); if (attributes == null) return; attributes.setReadOnly(readonly); try { setResourceAttributes(attributes); } catch (CoreException e) { // Failure is not an option. } }
public static void setWriteable(String path) throws Exception { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path)); ResourceAttributes resourceAttributes = file.getResourceAttributes(); if (resourceAttributes != null) { resourceAttributes.setReadOnly(false); file.setResourceAttributes(resourceAttributes); } } }
/** * shouldContinueAndMakeFileEditable method comment. */ public boolean shouldContinueAndMakeFileEditable(IFile aFile) { boolean yes = isYesToAll || promptUserToSaveReadOnly(aFile); if (yes) aFile.getResourceAttributes().setReadOnly(false); return yes; } }
protected IStatus setWritable(final IFile[] files) { for (int i = 0; i < files.length; i++) { IFile file = files[i]; ResourceAttributes attributes = file.getResourceAttributes(); if (attributes != null) { attributes.setReadOnly(false); } try { file.setResourceAttributes(attributes); } catch (CoreException e) { return e.getStatus(); } } return Status.OK_STATUS; } }
protected IStatus setWritable(final IFile[] files) { for (int i = 0; i < files.length; i++) { IFile file = files[i]; ResourceAttributes attributes = file.getResourceAttributes(); if (attributes != null) { attributes.setReadOnly(false); } try { file.setResourceAttributes(attributes); } catch (CoreException e) { return e.getStatus(); } } return Status.OK_STATUS; } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { JavaManipulationPlugin.log(e); } } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { RefactoringCorePlugin.log(e); } } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { RefactoringCorePlugin.log(e); } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { JavaPlugin.log(e); } } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { RefactoringCorePlugin.log(e); } }
static void setReadOnly(IResource resource, boolean readOnly) { ResourceAttributes resourceAttributes = resource.getResourceAttributes(); if (resourceAttributes == null) // not supported on this platform for this resource return; resourceAttributes.setReadOnly(readOnly); try { resource.setResourceAttributes(resourceAttributes); } catch (CoreException e) { JavaPlugin.log(e); } } }
/** * Returns the resource attributes for this file. * * @param element * @return the attributes of the file */ public ResourceAttributes getResourceAttributes(Object element) { ResourceAttributes attributes = new ResourceAttributes(); TarEntry entry = (TarEntry) element; attributes.setExecutable((entry.getMode() & 0100) != 0); attributes.setReadOnly((entry.getMode() & 0200) == 0); return attributes; }
@Override public void performChange(IResource resource) throws CoreException { ResourceAttributes attrs = resource.getResourceAttributes(); if (attrs != null) { if (changedAttrs[0]) attrs.setReadOnly(finalAttrs[0]); if (changedAttrs[1]) attrs.setExecutable(finalAttrs[1]); if (changedAttrs[2]) attrs.setArchive(finalAttrs[2]); resource.setResourceAttributes(attrs); } } };
/** * Converts an IFileInfo object into a ResourceAttributes object. * @param fileInfo The file info * @return The resource attributes */ public static ResourceAttributes fileInfoToAttributes(IFileInfo fileInfo) { ResourceAttributes attributes = new ResourceAttributes(); attributes.setReadOnly(fileInfo.getAttribute(EFS.ATTRIBUTE_READ_ONLY)); attributes.setArchive(fileInfo.getAttribute(EFS.ATTRIBUTE_ARCHIVE)); attributes.setExecutable(fileInfo.getAttribute(EFS.ATTRIBUTE_EXECUTABLE)); attributes.setHidden(fileInfo.getAttribute(EFS.ATTRIBUTE_HIDDEN)); attributes.setSymbolicLink(fileInfo.getAttribute(EFS.ATTRIBUTE_SYMLINK)); attributes.set(EFS.ATTRIBUTE_GROUP_READ, fileInfo.getAttribute(EFS.ATTRIBUTE_GROUP_READ)); attributes.set(EFS.ATTRIBUTE_GROUP_WRITE, fileInfo.getAttribute(EFS.ATTRIBUTE_GROUP_WRITE)); attributes.set(EFS.ATTRIBUTE_GROUP_EXECUTE, fileInfo.getAttribute(EFS.ATTRIBUTE_GROUP_EXECUTE)); attributes.set(EFS.ATTRIBUTE_OTHER_READ, fileInfo.getAttribute(EFS.ATTRIBUTE_OTHER_READ)); attributes.set(EFS.ATTRIBUTE_OTHER_WRITE, fileInfo.getAttribute(EFS.ATTRIBUTE_OTHER_WRITE)); attributes.set(EFS.ATTRIBUTE_OTHER_EXECUTE, fileInfo.getAttribute(EFS.ATTRIBUTE_OTHER_EXECUTE)); return attributes; }