TPTP 4.2.0 Platform Project
Internal API Specification

org.eclipse.hyades.ui.internal.wizard.exampleproject
Class ZipAdjusterCreationWizard

java.lang.Object
  extended byorg.eclipse.jface.wizard.Wizard
      extended byorg.eclipse.ui.wizards.newresource.BasicNewResourceWizard
          extended byorg.eclipse.hyades.ui.internal.wizard.exampleproject.CreationWizard
              extended byorg.eclipse.hyades.ui.internal.wizard.exampleproject.ZipAdjusterCreationWizard
All Implemented Interfaces:
org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.INewWizard, IProjectAdjuster, org.eclipse.jface.wizard.IWizard, org.eclipse.ui.IWorkbenchWizard

public abstract class ZipAdjusterCreationWizard
extends CreationWizard
implements IProjectAdjuster

Subclass of the CreationWizard that adjusts the contents of zip files to reflect the name of the project that was chosen by the user.

The zip file extensions to be changed are supposed to be defined in the implementation of addZipExtensions().

The zip is supposed to contain only text files that are encoded as defined in setEncoding(String). The default encoding is "UTF-8".

Since:
0.0.1

Field Summary
 
Fields inherited from class org.eclipse.ui.wizards.newresource.BasicNewResourceWizard
selection
 
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
 
Constructor Summary
ZipAdjusterCreationWizard()
          Constructor for ComptestExampleCreationWizard.
 
Method Summary
 boolean addZipExtension(java.lang.String zipExtension)
          Adds a zip extension to be changed by this wizard.
protected abstract  void addZipExtensions()
          Clients should add the extension to be changed in this method by using the addZipExtension(String).
 java.io.File adjust(CreationWizardPage[] pages, CreationWizardPage currentPage, java.io.File file)
           
 java.util.zip.ZipFile adjust(CreationWizardPage[] pages, CreationWizardPage currentPage, java.util.zip.ZipFile zipFile)
           
 void afterWorspaceRefresh(CreationWizardPage[] pages)
           
 void beforeWorspaceRefresh(CreationWizardPage[] pages)
           
 java.util.zip.ZipFile copyZip(java.lang.String sourceZip, java.lang.String targetZip, java.lang.String[] oldPats, java.lang.String[] newPats)
          Creates a copy of a zip file.
 void dispose()
           
 void finished(CreationWizardPage page, java.io.File file)
           
 void finished(CreationWizardPage page, java.util.zip.ZipFile zipFile)
           
 java.lang.String getEncoding()
          Returns the current encoding for the contents of the zip files.
 void removeAllZipExtensions()
          Removes all zip extension that are changed by this wizard.
 boolean removeZipExtension(java.lang.String zipExtension)
          Removes a zip extension to be changed by this wizard.
 void setEncoding(java.lang.String encoding)
          Sets the current encoding for the contents of the zip files.
 
Methods inherited from class org.eclipse.hyades.ui.internal.wizard.exampleproject.CreationWizard
addPages, createPageControls, createWizardPage, disableResourceOpening, finishWork, getAdjuster, getCreationWizardPages, getPluginId, getPluginIdsToResolve, initializeDefaultPageImageDescriptor, performFinish, replaceClasspathVariables, replaceVariableByPluginDirectory, setAdjuster, setInitializationData
 
Methods inherited from class org.eclipse.ui.wizards.newresource.BasicNewResourceWizard
getSelection, getWorkbench, init, selectAndReveal, selectAndReveal
 
Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchWizard
init
 
Methods inherited from interface org.eclipse.jface.wizard.IWizard
canFinish, getContainer, getDefaultPageImage, getDialogSettings, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer
 

Constructor Detail

ZipAdjusterCreationWizard

public ZipAdjusterCreationWizard()
Constructor for ComptestExampleCreationWizard.

Method Detail

addZipExtensions

protected abstract void addZipExtensions()
Clients should add the extension to be changed in this method by using the addZipExtension(String).


dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.jface.wizard.IWizard
See Also:
IWizard.dispose()

addZipExtension

public boolean addZipExtension(java.lang.String zipExtension)
Adds a zip extension to be changed by this wizard.

Parameters:
zipExtension -
Returns:

removeZipExtension

public boolean removeZipExtension(java.lang.String zipExtension)
Removes a zip extension to be changed by this wizard.

Parameters:
zipExtension -
Returns:

removeAllZipExtensions

public void removeAllZipExtensions()
Removes all zip extension that are changed by this wizard.


adjust

public java.util.zip.ZipFile adjust(CreationWizardPage[] pages,
                                    CreationWizardPage currentPage,
                                    java.util.zip.ZipFile zipFile)
Specified by:
adjust in interface IProjectAdjuster

finished

public void finished(CreationWizardPage page,
                     java.util.zip.ZipFile zipFile)
Specified by:
finished in interface IProjectAdjuster

adjust

public java.io.File adjust(CreationWizardPage[] pages,
                           CreationWizardPage currentPage,
                           java.io.File file)
Specified by:
adjust in interface IProjectAdjuster

finished

public void finished(CreationWizardPage page,
                     java.io.File file)
Specified by:
finished in interface IProjectAdjuster

copyZip

public java.util.zip.ZipFile copyZip(java.lang.String sourceZip,
                                     java.lang.String targetZip,
                                     java.lang.String[] oldPats,
                                     java.lang.String[] newPats)
                              throws java.io.IOException,
                                     java.io.FileNotFoundException
Creates a copy of a zip file. If an entry has a pattern oldPat[i] it will be replaced by newPat[i]. If this feature is not required the arrays should be null or 0 length (but it will be much faster to perform a simple file copy since this method reads each entry from the source file).

Throws:
java.io.IOException
java.io.FileNotFoundException

beforeWorspaceRefresh

public void beforeWorspaceRefresh(CreationWizardPage[] pages)
Specified by:
beforeWorspaceRefresh in interface IProjectAdjuster

afterWorspaceRefresh

public void afterWorspaceRefresh(CreationWizardPage[] pages)
Specified by:
afterWorspaceRefresh in interface IProjectAdjuster

getEncoding

public java.lang.String getEncoding()
Returns the current encoding for the contents of the zip files.

Returns:
String

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the current encoding for the contents of the zip files.


TPTP 4.2.0 Platform Project
Internal API Specification