本文整理汇总了Java中org.uberfire.ext.editor.commons.client.menu.MenuItems类的典型用法代码示例。如果您正苦于以下问题:Java MenuItems类的具体用法?Java MenuItems怎么用?Java MenuItems使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MenuItems类属于org.uberfire.ext.editor.commons.client.menu包,在下文中一共展示了MenuItems类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDecisionTableSelected
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
protected void onDecisionTableSelected(final DecisionTableSelectedEvent event) {
final Optional<GuidedDecisionTableView.Presenter> dtPresenter = event.getPresenter();
enableMenuItem(dtPresenter.isPresent(),
MenuItems.VALIDATE);
if (!dtPresenter.isPresent()) {
activeDocument = null;
return;
}
final GuidedDecisionTableView.Presenter presenter = dtPresenter.get();
if (!modeller.isDecisionTableAvailable(presenter)) {
return;
}
if (presenter.equals(getActiveDocument())) {
return;
}
activateDocument(presenter);
}
示例2: checkOnDecisionTableSelectedWhenAvailableSelected
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void checkOnDecisionTableSelectedWhenAvailableSelected() {
final ObservablePath path = mock(ObservablePath.class);
final PlaceRequest placeRequest = mock(PlaceRequest.class);
final GuidedDecisionTableEditorContent content = makeDecisionTableContent();
final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable(path,
path,
placeRequest,
content);
final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter);
when(modeller.isDecisionTableAvailable(any(GuidedDecisionTableView.Presenter.class))).thenReturn(true);
when(presenter.getActiveDocument()).thenReturn(dtPresenter);
presenter.onDecisionTableSelected(event);
verify(presenter,
never()).activateDocument(any(GuidedDecisionTableView.Presenter.class));
assertTrue(getMenuState(presenter.getMenus(),
MenuItems.VALIDATE));
}
示例3: checkOnDecisionTableSelectedWhenAvailableNotSelected
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void checkOnDecisionTableSelectedWhenAvailableNotSelected() {
final ObservablePath path = mock(ObservablePath.class);
final PlaceRequest placeRequest = mock(PlaceRequest.class);
final GuidedDecisionTableEditorContent content = makeDecisionTableContent();
final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable(path, path, placeRequest, content);
final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter);
final MultiPageEditor pageEditor = mock(MultiPageEditor.class);
when(modeller.isDecisionTableAvailable(any(GuidedDecisionTableView.Presenter.class))).thenReturn(true);
when(presenter.getActiveDocument()).thenReturn(null);
when(presenter.getKieEditorWrapperMultiPage()).thenReturn(pageEditor);
presenter.onStartup(path,
placeRequest);
presenter.onDecisionTableSelected(event);
verify(presenter,
times(1)).activateDocument(any(GuidedDecisionTableView.Presenter.class));
verify(radarMenuItem,
atLeast(1)).setEnabled(eq(true));
assertTrue(getMenuState(presenter.getMenus(),
MenuItems.VALIDATE));
}
示例4: checkOnDecisionTableSelectedWhenNotAvailable
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void checkOnDecisionTableSelectedWhenNotAvailable() {
final ObservablePath path = mock(ObservablePath.class);
final PlaceRequest placeRequest = mock(PlaceRequest.class);
final GuidedDecisionTableEditorContent content = makeDecisionTableContent();
final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable(path,
path,
placeRequest,
content);
final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter);
when(modeller.isDecisionTableAvailable(any(GuidedDecisionTableView.Presenter.class))).thenReturn(false);
presenter.onDecisionTableSelected(event);
verify(presenter,
never()).activateDocument(any(GuidedDecisionTableView.Presenter.class));
assertTrue(getMenuState(presenter.getMenus(),
MenuItems.VALIDATE));
}
示例5: testOnRepositoryRemoved
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void testOnRepositoryRemoved() {
final Repository repository = mock(Repository.class);
when(workbenchContext.getActiveWorkspaceProject()).thenReturn(Optional.of(new WorkspaceProject(mock(OrganizationalUnit.class),
repository,
mock(Branch.class),
mock(Module.class))));
editor.setupMenuBar();
editor.onRepositoryRemoved(new RepositoryRemovedEvent(repository));
verify(editor,
times(1)).enableMenus(eq(false));
verify(editor,
times(4)).enableMenuItem(eq(false),
any(MenuItems.class));
verify(saveMenuItem,
times(1)).setEnabled(eq(false));
verify(versionManagerMenuItem,
times(1)).setEnabled(eq(false));
}
示例6: init
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
protected void init(final ObservablePath path,
final PlaceRequest place,
final ClientResourceType type,
final MenuItems... menuItems) {
init(path,
place,
type,
true,
false,
menuItems);
}
示例7: testInitResetsConcurrentSessionInfo
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void testInitResetsConcurrentSessionInfo() throws Exception {
kieEditor.isReadOnly = false;
when(kieEditor.versionRecordManager.isCurrentLatest()).thenReturn(true);
kieEditor.concurrentUpdateSessionInfo = new ObservablePath.OnConcurrentUpdateEvent() {
@Override
public Path getPath() {
return null;
}
@Override
public String getId() {
return null;
}
@Override
public User getIdentity() {
return null;
}
};
kieEditor.init(new ObservablePathImpl(),
kieEditor.place,
kieEditor.type,
kieEditor.menuItems.toArray(new MenuItems[0]));
kieEditor.onSave();
verify(kieEditor,
never()).showConcurrentUpdatePopup();
}
示例8: addMenuItem
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
protected void addMenuItem(List<MenuItems> menuItems,
MenuItems item,
boolean add) {
if (add) {
menuItems.add(item);
}
}
示例9: initialiseEditorTabsWhenNoDocuments
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
void initialiseEditorTabsWhenNoDocuments() {
getEditMenuItem().setEnabled(false);
getViewMenuItem().setEnabled(false);
getInsertMenuItem().setEnabled(false);
getRadarMenuItem().setEnabled(false);
enableMenuItem(false,
MenuItems.VALIDATE);
kieEditorWrapperView.clear();
kieEditorWrapperView.addMainEditorPage(editorView);
kieEditorWrapperView.addOverviewPage(overviewWidget,
() -> overviewWidget.refresh(versionRecordManager.getVersion()));
overviewWidget.setContent(content.getOverview(),
versionRecordManager.getPathToLatest());
}
示例10: checkOnDecisionTableSelectedEventNoTableSelected
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void checkOnDecisionTableSelectedEventNoTableSelected() {
final DecisionTableSelectedEvent event = DecisionTableSelectedEvent.NONE;
presenter.onDecisionTableSelected(event);
verify(presenter,
never()).activateDocument(any(GuidedDecisionTableView.Presenter.class));
assertFalse(getMenuState(presenter.getMenus(),
MenuItems.VALIDATE));
}
示例11: init
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Override
protected void init(final ObservablePath path,
final PlaceRequest place,
final ClientResourceType type,
final MenuItems... menuItems) {
this.init(path,
place,
type,
true,
false,
menuItems);
}
示例12: enableMenus
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
/**
* Enable/disable all menus associated with the MDI container, consisting of "Save", "Copy",
* "Rename", "Delete", "Validate" and "VersionRecordManager" drop-down. Subclasses can override
* this to customize their Menus.
* @param enabled
*/
protected void enableMenus(final boolean enabled) {
getSaveMenuItem().setEnabled(enabled);
getVersionManagerMenuItem().setEnabled(enabled);
enableMenuItem(enabled,
MenuItems.COPY);
enableMenuItem(enabled,
MenuItems.RENAME);
enableMenuItem(enabled,
MenuItems.DELETE);
enableMenuItem(enabled,
MenuItems.VALIDATE);
}
示例13: enableMenuItem
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
/**
* Enable/disable a single menu associated with the MDI container.
* @param enabled
*/
protected void enableMenuItem(final boolean enabled,
final MenuItems menuItem) {
if (menus.getItemsMap().containsKey(menuItem)) {
menus.getItemsMap().get(menuItem).setEnabled(enabled);
}
}
示例14: testConcurrentRenameCommandIgnore
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void testConcurrentRenameCommandIgnore() {
final TestDocument document = createTestDocument();
final ObservablePath path = document.getLatestPath();
concurrentRenameCommand = editor.getConcurrentRenameOnIgnoreCommand();
editor.setupMenuBar();
registerDocument(document);
final ArgumentCaptor<ParameterizedCommand> renameCommandCaptor = ArgumentCaptor.forClass(ParameterizedCommand.class);
verify(path,
times(1)).onConcurrentRename(renameCommandCaptor.capture());
final ParameterizedCommand renameCommand = renameCommandCaptor.getValue();
assertNotNull(renameCommand);
final ObservablePath.OnConcurrentRenameEvent info = mock(ObservablePath.OnConcurrentRenameEvent.class);
renameCommand.execute(info);
verify(editor,
times(1)).enableMenus(eq(false));
verify(editor,
times(4)).enableMenuItem(eq(false),
any(MenuItems.class));
verify(saveMenuItem,
times(1)).setEnabled(eq(false));
verify(versionManagerMenuItem,
times(1)).setEnabled(eq(false));
}
示例15: testDeleteCommand
import org.uberfire.ext.editor.commons.client.menu.MenuItems; //导入依赖的package包/类
@Test
public void testDeleteCommand() {
final TestDocument document = createTestDocument();
final ObservablePath path = document.getLatestPath();
editor.setupMenuBar();
registerDocument(document);
final ArgumentCaptor<Command> deleteCommandCaptor = ArgumentCaptor.forClass(Command.class);
verify(path,
times(1)).onDelete(deleteCommandCaptor.capture());
final Command deleteCommand = deleteCommandCaptor.getValue();
assertNotNull(deleteCommand);
deleteCommand.execute();
verify(editor,
times(1)).enableMenus(eq(false));
verify(editor,
times(4)).enableMenuItem(eq(false),
any(MenuItems.class));
verify(saveMenuItem,
times(1)).setEnabled(eq(false));
verify(versionManagerMenuItem,
times(1)).setEnabled(eq(false));
verify(editor,
times(1)).removeDocument(eq(document));
verify(registeredDocumentsMenuBuilder,
times(1)).deregisterDocument(document);
}