|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcn.plinguaplugin.wizardCommonComponents.FileCreator
public abstract class FileCreator
This abstract class creates files and reports errors on shells in case they occurred. It's intended to provide support for wizard actions, as many of them create new files when they finish
Constructor Summary | |
---|---|
FileCreator()
|
Method Summary | |
---|---|
static void |
copyAndCloseStreams(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Copies an input stream to an output stream and closes them |
static void |
copyStreams(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Copies an input stream to an output stream |
static void |
createFile(java.io.InputStream content,
java.lang.String fileName,
java.lang.String containerName,
org.eclipse.swt.widgets.Shell shell,
org.eclipse.core.runtime.IProgressMonitor monitor)
Creates a new file on the container and file specified with the workspace |
static boolean |
executeContainerAction(org.eclipse.jface.wizard.IWizard wizard,
org.eclipse.jface.operation.IRunnableWithProgress operation,
org.eclipse.swt.widgets.Shell shell)
Executes an action on the container provided by a wizard |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileCreator()
Method Detail |
---|
public static void createFile(java.io.InputStream content, java.lang.String fileName, java.lang.String containerName, org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
content
- the content of the file to createfileName
- the name of the file to createcontainerName
- the name of the container where create the file inshell
- the shell to show if errors occurmonitor
- the monitor which show the file creatin progress
org.eclipse.core.runtime.CoreException
- if the file couldn't be createdpublic static boolean executeContainerAction(org.eclipse.jface.wizard.IWizard wizard, org.eclipse.jface.operation.IRunnableWithProgress operation, org.eclipse.swt.widgets.Shell shell)
wizard
- the wizard which executed the actionoperation
- the operation which executes the actionshell
- the shell where the error messages are displayed
public static void copyStreams(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
inputStream
- the input stream to copyoutputStream
- the destination output stream to write the input stream content
java.io.IOException
- if errors ocurred during the stream copypublic static void copyAndCloseStreams(java.io.InputStream inputStream, java.io.OutputStream outputStream) throws java.io.IOException
inputStream
- the input stream to copyoutputStream
- the destination output stream to write the input stream content
java.io.IOException
- if errors ocurred during the stream copy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |