Search in sources :

Example 1 with WorkbenchMenu

use of org.uberfire.client.annotations.WorkbenchMenu in project kie-wb-common by kiegroup.

the class M2RepoPerspective method getMenus.

@WorkbenchMenu
public void getMenus(final Consumer<Menus> menusConsumer) {
    menusConsumer.accept(MenuFactory.newTopLevelMenu(AppConstants.INSTANCE.Upload()).respondsWith(() -> {
        UploadFormPresenter uploadFormPresenter = iocManager.lookupBean(UploadFormPresenter.class).getInstance();
        uploadFormPresenter.showView();
    }).endMenu().newTopLevelMenu(AppConstants.INSTANCE.Refresh()).respondsWith(() -> refreshEvents.fire(new M2RepoRefreshEvent())).endMenu().build());
}
Also used : UploadFormPresenter(org.guvnor.m2repo.client.upload.UploadFormPresenter) M2RepoRefreshEvent(org.guvnor.m2repo.client.event.M2RepoRefreshEvent) WorkbenchMenu(org.uberfire.client.annotations.WorkbenchMenu)

Example 2 with WorkbenchMenu

use of org.uberfire.client.annotations.WorkbenchMenu in project drools-wb by kiegroup.

the class M2RepoPerspective method getMenus.

@WorkbenchMenu
public Menus getMenus() {
    return MenuFactory.newTopLevelMenu(AppConstants.INSTANCE.Upload()).respondsWith(new Command() {

        @Override
        public void execute() {
            UploadFormPresenter uploadFormPresenter = iocManager.lookupBean(UploadFormPresenter.class).getInstance();
            uploadFormPresenter.showView();
        }
    }).endMenu().newTopLevelMenu(AppConstants.INSTANCE.Refresh()).respondsWith(new Command() {

        @Override
        public void execute() {
            refreshEvents.fire(new M2RepoRefreshEvent());
        }
    }).endMenu().build();
}
Also used : Command(org.uberfire.mvp.Command) UploadFormPresenter(org.guvnor.m2repo.client.upload.UploadFormPresenter) M2RepoRefreshEvent(org.guvnor.m2repo.client.event.M2RepoRefreshEvent) WorkbenchMenu(org.uberfire.client.annotations.WorkbenchMenu)

Example 3 with WorkbenchMenu

use of org.uberfire.client.annotations.WorkbenchMenu in project drools-wb by kiegroup.

the class M2RepoPerspective method getMenus.

@WorkbenchMenu
public void getMenus(final Consumer<Menus> menusConsumer) {
    menusConsumer.accept(MenuFactory.newTopLevelMenu(AppConstants.INSTANCE.Upload()).respondsWith(() -> {
        UploadFormPresenter uploadFormPresenter = iocManager.lookupBean(UploadFormPresenter.class).getInstance();
        uploadFormPresenter.showView();
    }).endMenu().newTopLevelMenu(AppConstants.INSTANCE.Refresh()).respondsWith(() -> refreshEvents.fire(new M2RepoRefreshEvent())).endMenu().build());
}
Also used : UploadFormPresenter(org.guvnor.m2repo.client.upload.UploadFormPresenter) M2RepoRefreshEvent(org.guvnor.m2repo.client.event.M2RepoRefreshEvent) WorkbenchMenu(org.uberfire.client.annotations.WorkbenchMenu)

Aggregations

M2RepoRefreshEvent (org.guvnor.m2repo.client.event.M2RepoRefreshEvent)3 UploadFormPresenter (org.guvnor.m2repo.client.upload.UploadFormPresenter)3 WorkbenchMenu (org.uberfire.client.annotations.WorkbenchMenu)3 Command (org.uberfire.mvp.Command)1