当前位置: 首页>>代码示例>>Java>>正文


Java MenuItems类代码示例

本文整理汇总了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);
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:20,代码来源:BaseGuidedDecisionTableEditorPresenter.java

示例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));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:22,代码来源:BaseGuidedDecisionTableEditorPresenterTest.java

示例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));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:26,代码来源:BaseGuidedDecisionTableEditorPresenterTest.java

示例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));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:21,代码来源:BaseGuidedDecisionTableEditorPresenterTest.java

示例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));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:KieMultipleDocumentEditorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:BaseEditor.java

示例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();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:34,代码来源:KieEditorTest.java

示例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);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:PerspectiveEditorPresenter.java

示例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());
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:16,代码来源:GuidedDecisionTableGraphEditorPresenter.java

示例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));
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:12,代码来源:BaseGuidedDecisionTableEditorPresenterTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:13,代码来源:KieEditor.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:KieMultipleDocumentEditor.java

示例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);
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:11,代码来源:KieMultipleDocumentEditor.java

示例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));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:31,代码来源:KieMultipleDocumentEditorTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:30,代码来源:KieMultipleDocumentEditorTest.java


注:本文中的org.uberfire.ext.editor.commons.client.menu.MenuItems类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。