Skip to content
Permalink
Browse files
Merge pull request #546 from nadment/HOP-2352
HOP-2352 Fixed issues in the file menu
  • Loading branch information
hansva committed Jan 10, 2021
2 parents 2dae84e + 713d0f9 commit c605c72ec6f1795c1267b4f5608a7349257586ac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
@@ -626,6 +626,8 @@ public void menuFileClose() {
id = ID_MAIN_MENU_FILE_CLOSE_ALL,
label = "Close all",
parentId = ID_MAIN_MENU_FILE)
@GuiKeyboardShortcut(control = true, shift=true, key = 'w')
@GuiOsxKeyboardShortcut(command = true, shift=true, key = 'w')
public void menuFileCloseAll() {
if (fileDelegate.saveGuardAllFiles()) {
fileDelegate.closeAllFiles();
@@ -1042,13 +1044,17 @@ public void setUndoMenu(IUndo undoInterface) {
* @param running set this to true if the current file is running
* @param paused set this to true if the current file is paused
*/
public void handleFileCapabilities(IHopFileType fileType, boolean running, boolean paused) {
public void handleFileCapabilities(IHopFileType<?> fileType, boolean running, boolean paused) {

mainMenuWidgets.enableMenuItem(fileType, ID_MAIN_MENU_FILE_SAVE, IHopFileType.CAPABILITY_SAVE);
mainMenuWidgets.enableMenuItem(
fileType, ID_MAIN_MENU_FILE_SAVE_AS, IHopFileType.CAPABILITY_SAVE_AS);
mainMenuWidgets.enableMenuItem(
fileType, ID_MAIN_MENU_FILE_EXPORT_TO_SVG, IHopFileType.CAPABILITY_EXPORT_TO_SVG);
mainMenuWidgets.enableMenuItem(
fileType, ID_MAIN_MENU_FILE_CLOSE, IHopFileType.CAPABILITY_CLOSE);
mainMenuWidgets.enableMenuItem(
fileType, ID_MAIN_MENU_FILE_CLOSE_ALL, IHopFileType.CAPABILITY_CLOSE);

mainMenuWidgets.enableMenuItem(
fileType, ID_MAIN_MENU_EDIT_SELECT_ALL, IHopFileType.CAPABILITY_SELECT);
@@ -32,6 +32,7 @@
String CAPABILITY_NEW = "New";
String CAPABILITY_SAVE = "Save";
String CAPABILITY_SAVE_AS = "SaveAs";
String CAPABILITY_EXPORT_TO_SVG = "ExportToSvg";
String CAPABILITY_START = "Start";
String CAPABILITY_CLOSE = "Close";
String CAPABILITY_STOP = "Stop";
@@ -83,6 +83,7 @@ public Properties getCapabilities() {
capabilities.setProperty( IHopFileType.CAPABILITY_STOP, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_SAVE, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_SAVE_AS, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_EXPORT_TO_SVG, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_PAUSE, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_PREVIEW, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_DEBUG, "true" );
@@ -84,6 +84,7 @@ public Properties getCapabilities() {
capabilities.setProperty( IHopFileType.CAPABILITY_STOP, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_SAVE, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_SAVE_AS, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_EXPORT_TO_SVG, "true" );
capabilities.setProperty( IHopFileType.CAPABILITY_PAUSE, "false" );
capabilities.setProperty( IHopFileType.CAPABILITY_PREVIEW, "false" );
capabilities.setProperty( IHopFileType.CAPABILITY_DEBUG, "false" );
@@ -111,7 +111,9 @@ public HopDataOrchestrationPerspective() {
hopGui.setActivePerspective(this);
}

@Override public void perspectiveActivated() {
@Override
public void perspectiveActivated() {
HopGui.getInstance().handleFileCapabilities(getActiveFileTypeHandler().getFileType(), false, false);
}

@Override public boolean isActive() {

0 comments on commit c605c72

Please sign in to comment.