Package org.apache.hop.ui.core.metadata
Class MetadataManager<T extends IHopMetadata>
- java.lang.Object
-
- org.apache.hop.ui.core.metadata.MetadataManager<T>
-
public class MetadataManager<T extends IHopMetadata> extends Object
This is a utility class which allows you to create or edit metadata objects in a generic fashion
-
-
Constructor Summary
Constructors Constructor Description MetadataManager(IVariables variables, IHopMetadataProvider metadataProvider, Class<T> managedClass, org.eclipse.swt.widgets.Shell parentShell)
-
Method Summary
-
-
-
Constructor Detail
-
MetadataManager
public MetadataManager(IVariables variables, IHopMetadataProvider metadataProvider, Class<T> managedClass, org.eclipse.swt.widgets.Shell parentShell)
-
-
Method Detail
-
editMetadata
public boolean editMetadata()
edit an element- Returns:
- True if anything was changed
-
deleteMetadata
public boolean deleteMetadata()
delete an element- Returns:
- True if anything was changed
-
editMetadata
public boolean editMetadata(String elementName)
We look at the managed class name, add Dialog to it and then simply us that class to edit the dialog.- Parameters:
elementName- The name of the element to edit- Returns:
- True if anything was changed
-
editWithEditor
public void editWithEditor(String name)
-
deleteMetadata
public boolean deleteMetadata(String elementName)
delete an element- Parameters:
elementName- The name of the element to delete- Returns:
- True if anything was deleted
-
rename
public boolean rename(String oldName, String newName) throws HopException
- Throws:
HopException
-
getSerializer
public IHopMetadataSerializer<T> getSerializer() throws HopException
- Throws:
HopException
-
openMetaDialog
public boolean openMetaDialog(T object, IHopMetadataSerializer<T> serializer) throws Exception
- Throws:
Exception
-
newMetadata
public T newMetadata()
-
newMetadataWithEditor
public T newMetadataWithEditor()
-
getNames
public List<String> getNames() throws HopException
- Throws:
HopException
-
getNamesArray
public String[] getNamesArray() throws HopException
- Throws:
HopException
-
calculateDialogClassname
public String calculateDialogClassname()
-
calculateSimpleDialogClassname
public String calculateSimpleDialogClassname()
-
createEditor
public MetadataEditor<T> createEditor(T metadata) throws HopException
- Throws:
HopException
-
getMetadataProvider
public IHopMetadataProvider getMetadataProvider()
Gets metadataProvider- Returns:
- value of metadataProvider
-
setMetadataProvider
public void setMetadataProvider(IHopMetadataProvider metadataProvider)
- Parameters:
metadataProvider- The metadataProvider to set
-
getVariables
public IVariables getVariables()
Gets variables variables- Returns:
- value of variables variables
-
setVariables
public void setVariables(IVariables variables)
- Parameters:
variables- The variables variables to set
-
getClassLoader
public ClassLoader getClassLoader()
Gets classLoader- Returns:
- value of classLoader
-
setClassLoader
public void setClassLoader(ClassLoader classLoader)
- Parameters:
classLoader- The classLoader to set
-
getManagedName
protected String getManagedName()
-
setManagedClass
public void setManagedClass(Class<T> managedClass)
- Parameters:
managedClass- The managedClass to set
-
loadElement
public T loadElement(String selectedItem) throws HopException
- Throws:
HopException
-
-