Class ExplorerPerspective
- java.lang.Object
-
- org.apache.hop.ui.hopgui.perspective.explorer.ExplorerPerspective
-
- All Implemented Interfaces:
IActionContextHandlersProvider,IHopPerspective,TabClosable
@HopPerspectivePlugin(id="300-HopExplorerPerspective", name="i18n::ExplorerPerspective.Name", description="The Hop Explorer Perspective", image="ui/images/folder.svg") @GuiPlugin(description="i18n::ExplorerPerspective.GuiPlugin.Description") public class ExplorerPerspective extends Object implements IHopPerspective, TabClosable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExplorerPerspective.DetermineRootFolderExtension
-
Field Summary
Fields Modifier and Type Field Description static StringGUI_PLUGIN_TOOLBAR_PARENT_IDstatic StringGUI_TOOLBAR_CREATED_CALLBACK_IDstatic Class<?>PKGstatic StringTOOLBAR_ITEM_CREATE_FOLDERstatic StringTOOLBAR_ITEM_DELETEstatic StringTOOLBAR_ITEM_OPENstatic StringTOOLBAR_ITEM_REFRESHstatic StringTOOLBAR_ITEM_RENAME
-
Constructor Summary
Constructors Constructor Description ExplorerPerspective()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Switch to this perspective (shown).voidaddFile(ExplorerFile explorerFile)voidcloseTab(org.eclipse.swt.custom.CTabFolderEvent event, org.eclipse.swt.custom.CTabItem tabItem)Close the tab on the perspectivevoidcreateFolder()protected voidcreateTabFolder(org.eclipse.swt.widgets.Composite parent)protected voidcreateTree(org.eclipse.swt.widgets.Composite parent)voiddeleteFile()voiddetermineRootFolderName(HopGui hopGui)ExplorerFilegetActiveFile()IHopFileTypeHandlergetActiveFileTypeHandler()Get the active file type handler capable of saving, executing, printing, ...List<IGuiContextHandler>getContextHandlers()org.eclipse.swt.widgets.ControlgetControl()List<IExplorerFilePaintListener>getFilePaintListeners()Gets filePaintListenersIHopFileTypegetFileType(String path)org.eclipse.swt.graphics.ImagegetFileTypeImage(IHopFileType fileType)StringgetId()static ExplorerPerspectivegetInstance()List<TabItemHandler>getItems()Get the list of tabs handled by and currently open in the perspectiveList<IExplorerRefreshListener>getRefreshListeners()Gets refreshListenersList<IExplorerRootChangedListener>getRootChangedListeners()Gets rootChangedListenersStringgetRootFolder()Gets rootFolderStringgetRootName()Gets rootNameList<ISearchable>getSearchables()ExplorerFilegetSelectedFile()Which file is selected in the tree.List<IExplorerSelectionListener>getSelectionListeners()Gets selectionListenersprotected org.eclipse.swt.widgets.ShellgetShell()List<IHopFileType>getSupportedHopFileTypes()Get a list of supported file types for this perspectiveorg.eclipse.swt.custom.CTabFoldergetTabFolder()Get the tabFolder of the perspectiveGuiToolbarWidgetsgetToolBarWidgets()Gets toolBarWidgetsorg.eclipse.swt.widgets.TreegetTree()Gets treebooleanhasNavigationNextFile()booleanhasNavigationPreviousFile()voidinitialize(HopGui hopGui, org.eclipse.swt.widgets.Composite parent)Initialize this perspectivebooleanisActive()See if this perspective is active (shown)voidnavigateToNextFile()Navigate the file usage history to the next filevoidnavigateToPreviousFile()Navigate the file usage history to the previous filevoidonNewFile()protected voidonTabClose(org.eclipse.swt.custom.CTabFolderEvent event)voidopenFile()voidperspectiveActivated()Notify this perspective that it has been activated.voidrefresh()voidrefreshFileContent()booleanremove(IHopFileTypeHandler typeHandler)Remove this file type handler from the perspectivevoidrenameFile()voidsetActiveFile(ExplorerFile file)voidsetActiveFileTypeHandler(IHopFileTypeHandler fileTypeHandler)Set the focus on the given file type handler.voidupdateGui()Update HOP GUI menu and toolbar...voidupdateSelection()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hop.ui.hopgui.perspective.TabClosable
getOtherTabs, getTabsToLeft, getTabsToRight
-
-
-
-
Field Detail
-
PKG
public static final Class<?> PKG
-
GUI_TOOLBAR_CREATED_CALLBACK_ID
public static final String GUI_TOOLBAR_CREATED_CALLBACK_ID
- See Also:
- Constant Field Values
-
GUI_PLUGIN_TOOLBAR_PARENT_ID
public static final String GUI_PLUGIN_TOOLBAR_PARENT_ID
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_OPEN
public static final String TOOLBAR_ITEM_OPEN
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_CREATE_FOLDER
public static final String TOOLBAR_ITEM_CREATE_FOLDER
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_DELETE
public static final String TOOLBAR_ITEM_DELETE
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_RENAME
public static final String TOOLBAR_ITEM_RENAME
- See Also:
- Constant Field Values
-
TOOLBAR_ITEM_REFRESH
public static final String TOOLBAR_ITEM_REFRESH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ExplorerPerspective getInstance()
-
getId
public String getId()
- Specified by:
getIdin interfaceIHopPerspective
-
activate
@GuiKeyboardShortcut(control=true, shift=true, key=101) @GuiOsxKeyboardShortcut(command=true, shift=true, key=101) public void activate()
Description copied from interface:IHopPerspectiveSwitch to this perspective (shown).- Specified by:
activatein interfaceIHopPerspective
-
perspectiveActivated
public void perspectiveActivated()
Description copied from interface:IHopPerspectiveNotify this perspective that it has been activated.- Specified by:
perspectiveActivatedin interfaceIHopPerspective
-
isActive
public boolean isActive()
Description copied from interface:IHopPerspectiveSee if this perspective is active (shown)- Specified by:
isActivein interfaceIHopPerspective- Returns:
- True if the perspective is currently shown
-
getSupportedHopFileTypes
public List<IHopFileType> getSupportedHopFileTypes()
Description copied from interface:IHopPerspectiveGet a list of supported file types for this perspective- Specified by:
getSupportedHopFileTypesin interfaceIHopPerspective- Returns:
- The list of supported file types
-
initialize
public void initialize(HopGui hopGui, org.eclipse.swt.widgets.Composite parent)
Description copied from interface:IHopPerspectiveInitialize this perspective- Specified by:
initializein interfaceIHopPerspective- Parameters:
hopGui- The parent Hop GUI
-
determineRootFolderName
public void determineRootFolderName(HopGui hopGui)
-
createTree
protected void createTree(org.eclipse.swt.widgets.Composite parent)
-
createTabFolder
protected void createTabFolder(org.eclipse.swt.widgets.Composite parent)
-
closeTab
public void closeTab(org.eclipse.swt.custom.CTabFolderEvent event, org.eclipse.swt.custom.CTabItem tabItem)Description copied from interface:TabClosableClose the tab on the perspective- Specified by:
closeTabin interfaceTabClosable
-
getTabFolder
public org.eclipse.swt.custom.CTabFolder getTabFolder()
Description copied from interface:TabClosableGet the tabFolder of the perspective- Specified by:
getTabFolderin interfaceTabClosable
-
addFile
public void addFile(ExplorerFile explorerFile)
-
refreshFileContent
public void refreshFileContent()
-
getSelectedFile
public ExplorerFile getSelectedFile()
Which file is selected in the tree. It's not delivering a type or handler- Returns:
- The selected explorer file or null if nothing is selected
-
setActiveFile
public void setActiveFile(ExplorerFile file)
-
getActiveFile
public ExplorerFile getActiveFile()
-
getActiveFileTypeHandler
public IHopFileTypeHandler getActiveFileTypeHandler()
Description copied from interface:IHopPerspectiveGet the active file type handler capable of saving, executing, printing, ... a file- Specified by:
getActiveFileTypeHandlerin interfaceIHopPerspective- Returns:
- The active file type handler
-
setActiveFileTypeHandler
public void setActiveFileTypeHandler(IHopFileTypeHandler fileTypeHandler)
Description copied from interface:IHopPerspectiveSet the focus on the given file type handler.- Specified by:
setActiveFileTypeHandlerin interfaceIHopPerspective
-
onTabClose
protected void onTabClose(org.eclipse.swt.custom.CTabFolderEvent event)
-
openFile
@GuiToolbarElement(root="ExplorerPerspective-Toolbar", id="ExplorerPerspective-Toolbar-10000-Open", toolTip="i18n::ExplorerPerspective.ToolbarElement.Open.Tooltip", image="ui/images/arrow-right.svg") public void openFile()
-
createFolder
@GuiToolbarElement(root="ExplorerPerspective-Toolbar", id="ExplorerPerspective-Toolbar-10050-CreateFolder", toolTip="i18n::ExplorerPerspective.ToolbarElement.CreateFolder.Tooltip", image="ui/images/folder-add.svg") public void createFolder()
-
deleteFile
@GuiToolbarElement(root="ExplorerPerspective-Toolbar", id="ExplorerPerspective-Toolbar-10100-Delete", toolTip="i18n::ExplorerPerspective.ToolbarElement.Delete.Tooltip", image="ui/images/delete.svg", separator=true) @GuiKeyboardShortcut(key=127) @GuiOsxKeyboardShortcut(key=127) public void deleteFile()
-
renameFile
@GuiToolbarElement(root="ExplorerPerspective-Toolbar", id="ExplorerPerspective-Toolbar-10200-Rename", toolTip="i18n::ExplorerPerspective.ToolbarElement.Rename.Tooltip", image="ui/images/rename.svg", separator=false) @GuiKeyboardShortcut(key=16777227) @GuiOsxKeyboardShortcut(key=16777227) public void renameFile()
-
onNewFile
public void onNewFile()
-
refresh
@GuiToolbarElement(root="ExplorerPerspective-Toolbar", id="ExplorerPerspective-Toolbar-10300-Refresh", toolTip="i18n::ExplorerPerspective.ToolbarElement.Refresh.Tooltip", image="ui/images/refresh.svg") @GuiKeyboardShortcut(key=16777230) @GuiOsxKeyboardShortcut(key=16777230) public void refresh()
-
getFileTypeImage
public org.eclipse.swt.graphics.Image getFileTypeImage(IHopFileType fileType)
-
getFileType
public IHopFileType getFileType(String path) throws HopException
- Throws:
HopException
-
updateSelection
public void updateSelection()
-
remove
public boolean remove(IHopFileTypeHandler typeHandler)
Description copied from interface:IHopPerspectiveRemove this file type handler from the perspective- Specified by:
removein interfaceIHopPerspective- Parameters:
typeHandler- The file type handler to remove- Returns:
-
getItems
public List<TabItemHandler> getItems()
Description copied from interface:IHopPerspectiveGet the list of tabs handled by and currently open in the perspective- Specified by:
getItemsin interfaceIHopPerspective- Returns:
- The list of tab items
-
navigateToPreviousFile
public void navigateToPreviousFile()
Description copied from interface:IHopPerspectiveNavigate the file usage history to the previous file- Specified by:
navigateToPreviousFilein interfaceIHopPerspective
-
navigateToNextFile
public void navigateToNextFile()
Description copied from interface:IHopPerspectiveNavigate the file usage history to the next file- Specified by:
navigateToNextFilein interfaceIHopPerspective
-
hasNavigationPreviousFile
public boolean hasNavigationPreviousFile()
- Specified by:
hasNavigationPreviousFilein interfaceIHopPerspective
-
hasNavigationNextFile
public boolean hasNavigationNextFile()
- Specified by:
hasNavigationNextFilein interfaceIHopPerspective
-
getControl
public org.eclipse.swt.widgets.Control getControl()
- Specified by:
getControlin interfaceIHopPerspective- Returns:
- The control of this perspective
-
getShell
protected org.eclipse.swt.widgets.Shell getShell()
-
getContextHandlers
public List<IGuiContextHandler> getContextHandlers()
- Specified by:
getContextHandlersin interfaceIActionContextHandlersProvider
-
getSearchables
public List<ISearchable> getSearchables()
- Specified by:
getSearchablesin interfaceIHopPerspective- Returns:
- A list of searchable items
-
updateGui
public void updateGui()
Update HOP GUI menu and toolbar...
-
getRootChangedListeners
public List<IExplorerRootChangedListener> getRootChangedListeners()
Gets rootChangedListeners- Returns:
- value of rootChangedListeners
-
getToolBarWidgets
public GuiToolbarWidgets getToolBarWidgets()
Gets toolBarWidgets- Returns:
- value of toolBarWidgets
-
getFilePaintListeners
public List<IExplorerFilePaintListener> getFilePaintListeners()
Gets filePaintListeners- Returns:
- value of filePaintListeners
-
getRootFolder
public String getRootFolder()
Gets rootFolder- Returns:
- value of rootFolder
-
getRootName
public String getRootName()
Gets rootName- Returns:
- value of rootName
-
getRefreshListeners
public List<IExplorerRefreshListener> getRefreshListeners()
Gets refreshListeners- Returns:
- value of refreshListeners
-
getSelectionListeners
public List<IExplorerSelectionListener> getSelectionListeners()
Gets selectionListeners- Returns:
- value of selectionListeners
-
getTree
public org.eclipse.swt.widgets.Tree getTree()
Gets tree- Returns:
- value of tree
-
-