|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmlspecs.eclipse.jdt.internal.esc2.Utils
public class Utils
This class contains a number of (static) utility methods for use in plugins.
Field Summary | |
---|---|
static java.lang.String |
eol
A convenience holder for the end-of-line String for the current platform. |
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static ICommand[] |
addBuilder(IProject project,
ICommand[] commands,
IProjectDescription description,
java.lang.String builder,
boolean enabled)
Adds the given builder to the list of commands. |
static void |
addBuilder(IProject project,
java.lang.String builder)
Adds an enabled builder to the given project |
static boolean |
addNature(IProject project,
java.lang.String natureId)
Adds the given nature to the given project, if it is not already added |
static java.lang.String |
doubleBackslash(java.lang.String s)
This method does what I think s.replaceAll("\\","\\\\") is supposed to do, but that crashes. |
static int |
execAndWait(java.lang.String[] args)
|
static int |
execAndWait(java.lang.String command,
java.lang.String[] env,
java.io.File cd)
|
static java.lang.String |
findPluginResource(java.lang.String pluginName,
java.lang.String path)
Returns the absolute file system location of a file inside a plugin. |
static boolean |
isBuilderEnabled(IProject p,
java.lang.String builder)
Checks whether a project is enabled for a given builder (both has the builder and the builder is turned on). |
static boolean |
isDisabledCommand(ICommand c,
java.lang.String b)
This routine checks whether the given command is a disabled instance of the given builder. |
static boolean |
isEnabledCommand(ICommand c,
java.lang.String b)
This routine checks whether the given command is an enabled instance of the given builder. |
static ICommand |
newDisabledCommand(IProject project,
IProjectDescription description,
java.lang.String builder)
This method creates a new builder command of the specified type, but in a disabled state. |
static void |
readAllInput(java.io.InputStream i,
java.io.OutputStream o)
Reads input from the input and writes it to the output until the input stream runs out of data, but does all this in a new thread. |
static ICommand[] |
removeBuilder(ICommand[] commands,
java.lang.String builder)
Removes the given builder from the list of commands. |
static void |
removeBuilder(IProject project,
java.lang.String builder)
Removes the given builder from a project. |
static boolean |
removeNature(IProject project,
java.lang.String natureId)
Removes the given nature from the given project, if it is present |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String eol
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static boolean addNature(IProject project, java.lang.String natureId) throws org.eclipse.core.runtime.CoreException
project
- The project to add the nature tonatureId
- The nature to add
org.eclipse.core.runtime.CoreException
public static boolean removeNature(IProject project, java.lang.String natureId) throws org.eclipse.core.runtime.CoreException
project
- The project to remove the nature fromnatureId
- The nature to remove
org.eclipse.core.runtime.CoreException
public static boolean isEnabledCommand(ICommand c, java.lang.String b)
c
- The command to be testedb
- The builder
public static boolean isDisabledCommand(ICommand c, java.lang.String b)
c
- The command to be testedb
- The builder
public static ICommand newDisabledCommand(IProject project, IProjectDescription description, java.lang.String builder) throws org.eclipse.core.runtime.CoreException
project
- The project to which this will belongdescription
- The project descriptionbuilder
- The builder name
org.eclipse.core.runtime.CoreException
public static ICommand[] addBuilder(IProject project, ICommand[] commands, IProjectDescription description, java.lang.String builder, boolean enabled) throws org.eclipse.core.runtime.CoreException
project
- The project whose commands are being added tocommands
- The current set of project commandsdescription
- The current project's descriptionbuilder
- The name of the builder to add, if not already present.enabled
- If true, the builder is installed in the enabled state, if false
it is installed in the disabled state
org.eclipse.core.runtime.CoreException
public static void addBuilder(IProject project, java.lang.String builder) throws org.eclipse.core.runtime.CoreException
project
- The project to add a builder tobuilder
- The builder to add
org.eclipse.core.runtime.CoreException
public static ICommand[] removeBuilder(ICommand[] commands, java.lang.String builder)
commands
- The current set of project commandsbuilder
- The name of the builder to remove, if present.
public static void removeBuilder(IProject project, java.lang.String builder) throws org.eclipse.core.runtime.CoreException
project
- The project whose builder is to be removedbuilder
- The name of the builder to remove, if present.
org.eclipse.core.runtime.CoreException
public static boolean isBuilderEnabled(IProject p, java.lang.String builder) throws org.eclipse.core.runtime.CoreException
p
- The project to checkbuilder
- The id of the builder to look for
org.eclipse.core.runtime.CoreException
public static java.lang.String findPluginResource(java.lang.String pluginName, java.lang.String path) throws java.io.IOException
pluginName
- The name of the pluginpath
- The path (as a String) of the file within the plugin
java.io.IOException
public static java.lang.String doubleBackslash(java.lang.String s)
s
- Input string
public static void readAllInput(java.io.InputStream i, java.io.OutputStream o)
i
- Stream to read fromo
- Stream to write topublic static int execAndWait(java.lang.String[] args) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public static int execAndWait(java.lang.String command, java.lang.String[] env, java.io.File cd) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |