diff options
author | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2013-05-02 11:23:51 +0900 |
---|---|---|
committer | hyukmin kwon <hyukmin0530.kwon@samsung.com> | 2013-05-02 11:23:51 +0900 |
commit | 04d199f8c3c6470ee7bd80fb52e32224e761f734 (patch) | |
tree | 0a5e7247487c6eb175ad54f97f40a3f4be42070e | |
parent | d5eb8ba91bd89b3621e4ab965dfb36f1149e9e57 (diff) | |
download | jsdt-extension-eplugin-04d199f8c3c6470ee7bd80fb52e32224e761f734.tar.gz jsdt-extension-eplugin-04d199f8c3c6470ee7bd80fb52e32224e761f734.tar.bz2 jsdt-extension-eplugin-04d199f8c3c6470ee7bd80fb52e32224e761f734.zip |
[Title] Advanced Declaration View: NPE bug of the lock function is
fixed.
[Desc.] NPE bug of the lock function is fixed.
[Issue] REDMINE-9023
-rw-r--r-- | org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java index fcd583c..dac6bd7 100644 --- a/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java +++ b/org.tizen.web.advanceddeclarationview/src/org/tizen/web/advanceddeclarationview/ui/AdvancedDeclarationView.java @@ -98,6 +98,10 @@ public class AdvancedDeclarationView extends PageBookView implements ISelectionL /** The toggle line number ruler action */ private ToggleLineNumberAction fToggleLineNumberAction; + /** + * The current part for which the advanced declaration view is active + */ + private IWorkbenchPart currentPart = null; public ToggleLockAction getToggleLockAction() { return fToggleLockAction; @@ -199,10 +203,6 @@ public class AdvancedDeclarationView extends PageBookView implements ISelectionL @Override protected void showPageRec(PageRec pageRec) { - if (isLocked()) { - return; - } - super.showPageRec(pageRec); if (pageRec.page instanceof DeclarationPage) { @@ -218,13 +218,42 @@ public class AdvancedDeclarationView extends PageBookView implements ISelectionL if (getCurrentPage() instanceof DeclarationPage) { ((DeclarationPage) getCurrentPage()).computeAndSetInput(part); } - } + } + + @Override + protected void partHidden(IWorkbenchPart part) { + if (!isLocked()) { + super.partHidden(part); + } + } + + @Override + public void partActivated(IWorkbenchPart part) { + super.partActivated(part); + + if(isImportant(part)) { + currentPart = part; + } + } + + /* (non-Javadoc) + * @see org.eclipse.ui.part.PageBookView#partClosed(org.eclipse.ui.IWorkbenchPart) + * since 3.4 + */ + @Override + public void partClosed(IWorkbenchPart part) { + if (isLocked() && part.equals(currentPart)) { + getToggleLockAction().setChecked(false); + } + super.partClosed(part); + } /* * @see IWorkbenchPart#dispose() */ final public void dispose() { + currentPart = null; getSite().getWorkbenchWindow().getPartService().removePartListener(fPartListener); super.dispose(); } |