Project

General

Profile

Actions

bug #4945

open

Right click menu for polytomous key node list view needs correct enabling

Added by Andreas Müller almost 9 years ago. Updated over 2 years ago.

Status:
In Progress
Priority:
Priority13
Assignee:
Category:
taxeditor
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
Severity:
minor
Found in Version:

Description

In the polytomous key node list view the following right click menu items are offered:

  • New key number

  • New Alternative

  • Refresh node

  • Delete

However, even if no node exists yet, all these alternatives are enabled and visible. We should disable or make invisible those alternatives which are not available for the given selection or if no selection exists.

We may also need to discuss, if a node can be deleted if it is in the middle of the tree (not a leaf node). There might be a ticket for this elsewhere. If we decide that delete is not possible we may discuss if we disable delete for those nodes or if we enable and give feedback dialog which explains why delete is not possible.

Actions #1

Updated by Andreas Müller almost 9 years ago

  • Target version deleted ()
  • Priority changed from New to Priority13
  • Severity changed from normal to minor
Actions #2

Updated by Andreas Müller over 8 years ago

  • Subject changed from Right click menu for polytomous key needs correct enabling to Right click menu for polytomous key node list view needs correct enabling
Actions #3

Updated by Katja Luther over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #4

Updated by Katja Luther over 7 years ago

  • Description updated (diff)
  • Status changed from Resolved to New
  • Target version changed from Reviewed Next Major Release to Release 4.4
  • % Done changed from 50 to 0
Actions #5

Updated by Katja Luther over 7 years ago

  • Status changed from New to Resolved
Actions #6

Updated by Katja Luther over 7 years ago

  • % Done changed from 0 to 100
Actions #7

Updated by Katja Luther about 7 years ago

  • Assignee changed from Katja Luther to Andreas Müller
Actions #8

Updated by Andreas Müller about 7 years ago

  • Private changed from Yes to No
Actions #9

Updated by Andreas Müller about 7 years ago

Some issues:

  • Refresh nodes is disabled if no selection, however, it probably always refreshes all nodes of the key, therefore a selection of single nodes is not necessary and the menu entry may be always enabled, except for no node available in the key at all
  • New key number is still enabled and gives a feedback dialog if no selection available, while all other entries are disabled, this should be handled consistent
  • Insert Node is missing a German translation
  • Semantics of "Insert node" is maybe unclear, maybe we should call it "Insert key number linking here" or maybe better, as we use "New" for the 2 other insert functions "New key number linking here"
  • The menu should be rearranged:
    • Refresh nodes is functionally different to insert and delete, therefore we should put it to the bottom and separate it by a separator
    • We may order the "insert" functions by the order, where the new node is created. So put first "insert node" as it creates a node above the current selection, than add "Alternative node" as it creates a node below but with the same number, and finally add "New key number" as it creates a node below but with a higher key number
  • I wonder if we need "New Key Number" for those nodes already linking to another node, this functionality seems to be exactly the same as choosing "New Alternative" on the linked node. This may confuse users.
  • As semantics of the menu entries is not easy to understand and to explain in few words we need tool tips explaining more verbose what the single entries do.
  • We should think about creating the first node automatically when creating a new key

Some of these issues are not closely related to the subject of this ticket. So please feel free to create new tickets if needed. Also there might be an existing ticket for the new "Insert Node" functionality. Could you please relate these 2 tickets

Actions #10

Updated by Andreas Müller about 7 years ago

I tried to delete an in-between node answering the dialog if children should be deleted by "NO". This resulted in an IndexOutOfBound exception:

login : admin
editor version : 4.4.1
server : test.e-taxonomy.eu / edit-test
schema version : 4.1.0.0.201607300000
os : Windows Server 2012 6.2 amd64
java : 1.7.0_65
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
    at eu.etaxonomy.taxeditor.model.AbstractUtility$1.run(AbstractUtility.java:346)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2649)
    at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1346)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.progress.ProgressManager$7.run(ProgressManager.java:1184)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4683)
    at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1182)
    at eu.etaxonomy.taxeditor.model.AbstractUtility.runInUI(AbstractUtility.java:658)
    at eu.etaxonomy.taxeditor.model.AbstractUtility.executeOperation(AbstractUtility.java:364)
    at eu.etaxonomy.taxeditor.editor.key.polytomous.handler.DeleteNodeHandler.execute(DeleteNodeHandler.java:96)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
        ...
Caused by: java.lang.IndexOutOfBoundsException: Index: 5, Size: 2
    at java.util.ArrayList.rangeCheckForAdd(ArrayList.java:661)
    at java.util.ArrayList.add(ArrayList.java:473)
    at org.hibernate.collection.internal.PersistentList.add(PersistentList.java:325)
    at eu.etaxonomy.cdm.model.description.PolytomousKeyNode.addChild(PolytomousKeyNode.java:477)
    at eu.etaxonomy.cdm.model.description.PolytomousKeyNode.addChild(PolytomousKeyNode.java:445)
    at eu.etaxonomy.cdm.api.service.PolytomousKeyNodeServiceImpl.delete(PolytomousKeyNodeServiceImpl.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy625.delete(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    ...
Actions #11

Updated by Andreas Müller about 7 years ago

Andreas Müller wrote:

I tried to delete an in-between node answering the dialog if children should be deleted by "NO". This resulted in an IndexOutOfBound exception:

After trying to reopen the key I got an NPE. Only by first running "Refresh key nodes" I could open the key again

login : admin
editor version : 4.4.1
server : test.e-taxonomy.eu / edit-test
schema version : 4.1.0.0.201607300000
os : Windows Server 2012 6.2 amd64
java : 1.7.0_65
java.lang.NullPointerException
    at eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphContentProvider.getTreeRecursively(PolytomousKeyGraphContentProvider.java:65)
    at eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphContentProvider.getTreeRecursively(PolytomousKeyGraphContentProvider.java:70)
    at eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphContentProvider.getTreeRecursively(PolytomousKeyGraphContentProvider.java:70)
    at eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyGraphContentProvider.getElements(PolytomousKeyGraphContentProvider.java:48)
    at org.eclipse.zest.core.viewers.internal.GraphModelFactory.doBuildGraph(GraphModelFactory.java:54)
    at org.eclipse.zest.core.viewers.internal.GraphModelFactory.createGraphModel(GraphModelFactory.java:42)
    at org.eclipse.zest.core.viewers.internal.AbstractStructuredGraphViewer.inputChanged(AbstractStructuredGraphViewer.java:473)
    at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
    at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
    at eu.etaxonomy.taxeditor.editor.key.AbstractGraphKeyEditor.createPartControl(AbstractGraphKeyEditor.java:145)
    at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:241)
    at org.eclipse.ui.forms.editor.FormEditor.addPage(FormEditor.java:325)
    at eu.etaxonomy.taxeditor.editor.key.KeyEditor.addPages(KeyEditor.java:227)
    at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
    at eu.etaxonomy.taxeditor.editor.EditorUtil.open(EditorUtil.java:80)
    at eu.etaxonomy.taxeditor.editor.EditorUtil.open(EditorUtil.java:105)
    at eu.etaxonomy.taxeditor.editor.EditorUtil.openPolytomousKey(EditorUtil.java:408)
    at eu.etaxonomy.taxeditor.navigation.key.polytomous.handler.RemotingEditPolytomousKeyNodesHandler$1$1.run(RemotingEditPolytomousKeyNodesHandler.java:64)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at eu.etaxonomy.taxeditor.Application.start(Application.java:24)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Actions #12

Updated by Andreas Müller about 7 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 100 to 50
Actions #13

Updated by Andreas Müller almost 6 years ago

is this still an open issue?

Actions #14

Updated by Katja Luther over 2 years ago

  • Status changed from Feedback to In Progress
  • Target version changed from Release 4.4 to Release 5.45

Andreas Müller wrote:

is this still an open issue?

Yes, the menu shows delete and refresh even though there is no node in the key.

Actions

Also available in: Atom PDF