|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jet.taglib.workspace.ActionsUtil
public final class ActionsUtil
Utility class for workspace actions. Provides implementations of typical workspace operations needed by Workspace actions.
This class is not intended to be instantiated or subclassed by clients.
Method Summary | |
---|---|
static void |
checkpointWorkspace(boolean build)
Deprecated. Use checkpointWorkspace(boolean,IProgressMonitor) instead |
static void |
checkpointWorkspace(boolean build,
org.eclipse.core.runtime.IProgressMonitor monitor)
Force the workspace to broadcast accumulated workspace change events, and optionally do a build. |
static void |
createProject(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Create a new project. |
static void |
createProject(org.eclipse.core.resources.IProject project,
org.eclipse.core.resources.IProjectDescription description,
org.eclipse.core.runtime.IProgressMonitor monitor)
Create a new project. |
static void |
ensureFolderExists(org.eclipse.core.resources.IFolder folder,
org.eclipse.core.runtime.IProgressMonitor monitor)
Ensure that a folder exists by creating it and any of its parents if necessary. |
static byte[] |
readBinaryFile(java.net.URL url)
Read a binary file from the given URL. |
static java.lang.String |
readTextFile(java.net.URL url,
java.lang.String encoding)
Return the contents of the text file at the specified URL. |
static boolean |
writeBinaryFile(org.eclipse.core.resources.IFile file,
boolean replace,
byte[] contents,
org.eclipse.core.runtime.IProgressMonitor monitor)
Write a binary file from a byte buffer. |
static boolean |
writeTextFile(org.eclipse.core.resources.IFile file,
boolean replace,
java.lang.String encoding,
boolean derived,
java.lang.String contents,
org.eclipse.core.runtime.IProgressMonitor monitor)
Write the specified text file from a string. |
static boolean |
writeTextFileFromWriter(org.eclipse.core.resources.IFile file,
boolean replace,
java.lang.String encoding,
boolean derived,
JET2Writer writer,
org.eclipse.core.runtime.IProgressMonitor monitor)
Write the file with the specified options from a JET writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean writeTextFileFromWriter(org.eclipse.core.resources.IFile file, boolean replace, java.lang.String encoding, boolean derived, JET2Writer writer, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
This method delegates to writeTextFile
after finalizing the writer's content via JET2Writer.finalizeContent(Object)
.
If the content is written, then the writer is informed of this after the write via JET2Writer.contentCommitted(Object)
.
file
- the file to writereplace
- true
if existing verions of the file should be overwritten.encoding
- the file encoding or null
for the default encoding.derived
- true
if the file is derived (and will be ignored by the team environment.writer
- the writer containing the file's content.monitor
- a progress monitor
true
if the file was written, false
if replace
is true
and the file already exists..
JET2TagException
- if the file cannot be created or written, or the encoding is invalid.JET2Writer.finalizeContent(Object)
,
JET2Writer.contentCommitted(Object)
public static boolean writeTextFile(org.eclipse.core.resources.IFile file, boolean replace, java.lang.String encoding, boolean derived, java.lang.String contents, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
file
- the file to writereplace
- true
if existing verions of the file should be overwritten.encoding
- the file encoding or null
for the default encoding.derived
- true
if the file is derived (and will be ignored by the team environment.contents
- the contents to write.monitor
- a progress monitor
false
replace
was true
and the file existed; true
otherwise.
JET2TagException
- if the file cannot be created or written, or the encoding is invalid.public static void ensureFolderExists(org.eclipse.core.resources.IFolder folder, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
folder
- the folder to ensure exists.monitor
- a progress montiro
JET2TagException
- if the folder cannot be createdpublic static boolean writeBinaryFile(org.eclipse.core.resources.IFile file, boolean replace, byte[] contents, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
file
- the file to writereplace
- true
if existing versions of the file should be overwritten.contents
- the contents to write.monitor
- a progress monitor
true
if the file was written, false
if replace
was true
and the
file already exists.
JET2TagException
- if the file cannot be created or updated.public static java.lang.String readTextFile(java.net.URL url, java.lang.String encoding) throws JET2TagException
JET2TagException
- if an IOException is thrown (the IOException is wrapped).public static byte[] readBinaryFile(java.net.URL url) throws JET2TagException
url
- the file URL
JET2TagException
- if an IOException occurs (the exception is wrapped).public static void createProject(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
project
- the project to createmonitor
- a progress monitor
JET2TagException
- if an error occurspublic static void createProject(org.eclipse.core.resources.IProject project, org.eclipse.core.resources.IProjectDescription description, org.eclipse.core.runtime.IProgressMonitor monitor) throws JET2TagException
project
- the project to createdescription
- an option project descriptionmonitor
- a progress monitor
JET2TagException
- if an error occurspublic static void checkpointWorkspace(boolean build)
checkpointWorkspace(boolean,IProgressMonitor)
instead
Generally, workspace actions authors will not need this tag.
build
- true
if a workspace build should be performed after the event broadcast.IWorkspace.checkpoint(boolean)
public static void checkpointWorkspace(boolean build, org.eclipse.core.runtime.IProgressMonitor monitor)
Generally, workspace actions authors will not need this tag.
build
- true
if a workspace build should be performed after the event broadcast.monitor
- TODOIWorkspace.checkpoint(boolean)
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |