-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from pbroadbery/fricas-next-version
Completion can be cancelled, lexing is now incremental
- Loading branch information
Showing
22 changed files
with
302 additions
and
104 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
44 changes: 6 additions & 38 deletions
44
src/main/java/aldor/hierarchy/AbstractChangeHierarchyViewAction.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 |
---|---|---|
@@ -1,54 +1,22 @@ | ||
package aldor.hierarchy; | ||
|
||
import aldor.hierarchy.util.TypeHierarchyBrowserBaseEx; | ||
import com.intellij.ide.hierarchy.ChangeHierarchyViewActionBase; | ||
import com.intellij.ide.hierarchy.TypeHierarchyBrowserBase; | ||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.actionSystem.DataContext; | ||
import com.intellij.openapi.actionSystem.Presentation; | ||
import com.intellij.openapi.actionSystem.ToggleAction; | ||
import com.intellij.openapi.application.ApplicationManager; | ||
import org.jetbrains.annotations.NotNull; | ||
import com.intellij.openapi.actionSystem.PlatformDataKeys; | ||
import com.intellij.util.ui.UIUtil; | ||
|
||
import javax.swing.Icon; | ||
|
||
public abstract class AbstractChangeHierarchyViewAction extends ToggleAction { | ||
public abstract class AbstractChangeHierarchyViewAction extends ChangeHierarchyViewActionBase { | ||
|
||
AbstractChangeHierarchyViewAction(final String shortDescription, final String longDescription, final Icon icon) { | ||
super(shortDescription, longDescription, icon); | ||
} | ||
|
||
@Override | ||
public final boolean isSelected(final AnActionEvent event) { | ||
final TypeHierarchyBrowserBaseEx browser = (TypeHierarchyBrowserBaseEx) getTypeHierarchyBrowser(event.getDataContext()); | ||
return (browser != null) && getTypeName().equals(browser.typeName()); | ||
protected TypeHierarchyBrowserBase getHierarchyBrowser(DataContext context) { | ||
return UIUtil.getParentOfType(TypeHierarchyBrowserBase.class, context.getData(PlatformDataKeys.CONTEXT_COMPONENT)); | ||
} | ||
|
||
protected abstract String getTypeName(); | ||
|
||
@Override | ||
public final void setSelected(final AnActionEvent event, final boolean flag) { | ||
if (flag) { | ||
final TypeHierarchyBrowserBase browser = getTypeHierarchyBrowser(event.getDataContext()); | ||
// setWaitCursor(); | ||
ApplicationManager.getApplication().invokeLater(() -> { | ||
if (browser != null) { | ||
browser.changeView(getTypeName()); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
@Override | ||
public void update(@NotNull final AnActionEvent event) { | ||
// its important to assign the myTypeHierarchyBrowser first | ||
super.update(event); | ||
final Presentation presentation = event.getPresentation(); | ||
presentation.setEnabled(true); | ||
} | ||
|
||
static TypeHierarchyBrowserBase getTypeHierarchyBrowser(final DataContext context) { | ||
return TypeHierarchyBrowserBase.DATA_KEY.getData(context); | ||
} | ||
|
||
|
||
} |
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.