@Test public void testLocked_ActiveDocument() { when( editor.getActiveDocument() ).thenReturn( document ); when( document.getCurrentPath() ).thenReturn( path ); final Operation op = lockSyncHelper.enable( path, true, false ); assertEquals( Operation.DISABLE, op ); }
@Override public Operation enable(final Path file, final boolean isLocked, final boolean isLockedByCurrentUser) { final KieDocument activeDocument = editor.getActiveDocument(); if (activeDocument == null || !activeDocument.getCurrentPath().equals(file)) { return Operation.VETO; } return super.enable(file, isLocked, isLockedByCurrentUser); }
KieMultipleDocumentEditorLockSyncHelper extends HasLockSyncMenuStateHelper.BasicLockSyncMenuStateHelper { @Override public Operation enable(final Path file, final boolean isLocked, final boolean isLockedByCurrentUser) { final KieDocument activeDocument = editor.getActiveDocument(); if (activeDocument == null || !activeDocument.getCurrentPath().equals(file)) { return Operation.VETO; } return super.enable(file, isLocked, isLockedByCurrentUser); } }
KieMultipleDocumentEditorLockSyncHelper extends HasLockSyncMenuStateHelper.BasicLockSyncMenuStateHelper { @Override public Operation enable(final Path file, final boolean isLocked, final boolean isLockedByCurrentUser) { final KieDocument activeDocument = editor.getActiveDocument(); if (activeDocument == null || !activeDocument.getCurrentPath().equals(file)) { return Operation.VETO; } return super.enable(file, isLocked, isLockedByCurrentUser); } KieMultipleDocumentEditorLockSyncHelper(final KieMultipleDocumentEditor editor); }
KieMultipleDocumentEditorLockSyncHelper extends HasLockSyncMenuStateHelper.BasicLockSyncMenuStateHelper { @Override public Operation enable(final Path file, final boolean isLocked, final boolean isLockedByCurrentUser) { final KieDocument activeDocument = editor.getActiveDocument(); if (activeDocument == null || !activeDocument.getCurrentPath().equals(file)) { return Operation.VETO; } return super.enable(file, isLocked, isLockedByCurrentUser); } KieMultipleDocumentEditorLockSyncHelper(final KieMultipleDocumentEditor editor); @Override Operation enable(final Path file,
                            final boolean isLocked,
                            final boolean isLockedByCurrentUser); }
KieMultipleDocumentEditorLockSyncHelper extends HasLockSyncMenuStateHelper.BasicLockSyncMenuStateHelper { @Override public Operation enable(final Path file, final boolean isLocked, final boolean isLockedByCurrentUser) { final KieDocument activeDocument = editor.getActiveDocument(); if (activeDocument == null || !activeDocument.getCurrentPath().equals(file)) { return Operation.VETO; } return super.enable(file, isLocked, isLockedByCurrentUser); } KieMultipleDocumentEditorLockSyncHelper(final KieMultipleDocumentEditor editor); @Override Operation enable(final Path file,
                            final boolean isLocked,
                            final boolean isLockedByCurrentUser);  }