forked from eclipse/lsp4jakarta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Terminal issue fix, collapse/expand fix, execute task fix (eclipse#16)
* Terminal issue fix, collapse/expand fix, execute task fix Signed-off-by: Kathryn Kodama <[email protected]> * fixed action maps Signed-off-by: Kathryn Kodama <[email protected]>
- Loading branch information
1 parent
f646d6d
commit 7b9f00f
Showing
8 changed files
with
160 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/io/openliberty/tools/intellij/actions/LibertyToolbarActionGroup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package io.openliberty.tools.intellij.actions; | ||
|
||
import com.intellij.openapi.actionSystem.ActionManager; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.actionSystem.DefaultActionGroup; | ||
import com.intellij.ui.treeStructure.Tree; | ||
import com.intellij.ui.treeStructure.actions.CollapseAllAction; | ||
import com.intellij.ui.treeStructure.actions.ExpandAllAction; | ||
import io.openliberty.tools.intellij.util.Constants; | ||
|
||
public class LibertyToolbarActionGroup extends DefaultActionGroup { | ||
|
||
private CollapseAllAction collapseAction; | ||
private ExpandAllAction expandAction; | ||
private Tree tree; | ||
|
||
public LibertyToolbarActionGroup(Tree tree) { | ||
super("LibertyActionToolBar", false); | ||
this.tree = tree; | ||
final ActionManager actionManager = ActionManager.getInstance(); | ||
add(actionManager.getAction("io.openliberty.tools.intellij.actions.RefreshLibertyToolbar")); | ||
addSeparator(); | ||
add(actionManager.getAction("io.openliberty.tools.intellij.actions.ExecuteLibertyDevTask")); | ||
addSeparator(); | ||
|
||
this.collapseAction = new CollapseAllAction(tree); | ||
this.expandAction = new ExpandAllAction(tree); | ||
add(this.collapseAction); | ||
add(this.expandAction); | ||
} | ||
|
||
@Override | ||
public void update(AnActionEvent event) { | ||
// Enable/disable depending on whether user is editing... | ||
Tree updatedTree = (Tree) event.getDataContext().getData(Constants.LIBERTY_DASHBOARD_TREE); | ||
|
||
if (updatedTree != null && updatedTree != this.tree) { | ||
remove(this.collapseAction); | ||
remove(this.expandAction); | ||
CollapseAllAction newCollapseAction = new CollapseAllAction(updatedTree); | ||
ExpandAllAction newExpandAction = new ExpandAllAction(updatedTree); | ||
add(newCollapseAction); | ||
add(newExpandAction); | ||
this.collapseAction = newCollapseAction; | ||
this.expandAction = newExpandAction; | ||
this.tree = updatedTree; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.