public class ClassFileInterpreter extends Object implements IFileInterpreterProvider
Constructor and Description |
---|
ClassFileInterpreter() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateNewFile(IWorkbench workbench)
Tests whether a new file can be created at the current workbench state.
|
IFileInterpreter |
createFromFile(IAbstractFile file)
Creates a abstract file based on the given folder and file.
|
IFileInterpreter |
createNewFile(IAbstractFile file)
Should create a new file that matches the file type.
|
String |
getDescription()
Returns a description about the content of the file.
|
String |
getFileType()
Returns the file type as a string. e.g.
|
Icon |
getIcon()
Returns the icon of the file
|
IWizard |
getNewFileWizard()
Returns a wizard that can in several steps create a new file of the
providers file type.
|
boolean |
hasNewFileWizard()
Returns whether a wizard exists for this file type.
|
boolean |
matchFormat(IAbstractFile file)
This method returns true if:
- the file is a valid class file and testForSuperClass is set to false (default)
- the file is a valid class file and testForSuperClass is set to true and the Class
extends the given Superclass.
|
void |
setSuperClass(String name)
This method set the searched Superclass.
|
void |
testForSuperClass(boolean test)
This method disables/enables the test for a given Superclass.
|
public boolean canCreateNewFile(IWorkbench workbench)
IFileInterpreterProvider
canCreateNewFile
in interface IFileInterpreterProvider
workbench
- the current workbenchpublic IFileInterpreter createFromFile(IAbstractFile file) throws FileInterpreterProviderException
IFileInterpreterProvider
createFromFile
in interface IFileInterpreterProvider
file
- the file to which the project element should be assignedFileInterpreterProviderException
- -
if the file cannot be readpublic IFileInterpreter createNewFile(IAbstractFile file) throws FileInterpreterProviderException
IFileInterpreterProvider
createNewFile
in interface IFileInterpreterProvider
file
- the file that should be createdFileInterpreterProviderException
- -
if the file cannot be createdpublic String getDescription()
IFileInterpreterProvider
getDescription
in interface IFileInterpreterProvider
public String getFileType()
IFileInterpreterProvider
getFileType
in interface IFileInterpreterProvider
public Icon getIcon()
IFileInterpreterProvider
getIcon
in interface IFileInterpreterProvider
public IWizard getNewFileWizard()
IFileInterpreterProvider
getNewFileWizard
in interface IFileInterpreterProvider
public boolean hasNewFileWizard()
IFileInterpreterProvider
hasNewFileWizard
in interface IFileInterpreterProvider
public boolean matchFormat(IAbstractFile file) throws FileInterpreterProviderException
matchFormat
in interface IFileInterpreterProvider
file
- the file to testFileInterpreterProviderException
- -
if the file cannot be testedpublic void testForSuperClass(boolean test)
test
- true means test for Superclasspublic void setSuperClass(String name)
name
- full qualified class name of superclass