本文整理汇总了Java中org.uberfire.workbench.model.impl.PartDefinitionImpl类的典型用法代码示例。如果您正苦于以下问题:Java PartDefinitionImpl类的具体用法?Java PartDefinitionImpl怎么用?Java PartDefinitionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PartDefinitionImpl类属于org.uberfire.workbench.model.impl包,在下文中一共展示了PartDefinitionImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildPerspective
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Perspective
public PerspectiveDefinition buildPerspective() {
final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
perspective.setName(translationService.getTranslation(AppConstants.AdministrationPerspective_AdministrationPerspective));
perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("RepositoriesEditor")));
final PanelDefinition west = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
west.setWidth(300);
west.setMinWidth(200);
west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest("FileExplorer")));
perspective.getRoot().insertChild(CompassPosition.WEST,
west);
return perspective;
}
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:18,代码来源:AdministrationPerspective.java
示例2: buildParts
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
private void buildParts(final PanelDefinition panel,
final JsArray<JSPartDefinition> parts) {
if (parts != null) {
for (int i = 0; i < parts.length(); i++) {
final JSPartDefinition part = parts.get(i);
final PlaceRequest placeRequest = new DefaultPlaceRequest(part.getPlaceName());
if (part.getParameters() != null) {
final JSONObject json = new JSONObject(part.getParameters());
for (final String key : json.keySet()) {
placeRequest.addParameter(key,
json.get(key).isString().stringValue());
}
}
final PartDefinition partDefinition = new PartDefinitionImpl(placeRequest);
partDefinition.setContextDisplayMode(JSNativePerspective.this.getContextDisplayMode(part.getContextDisplayModeAsString(),
ContextDisplayMode.SHOW));
if (part.getContextId() != null) {
partDefinition.setContextDefinition(new ContextDefinitionImpl(new DefaultPlaceRequest(part.getContextId())));
}
panel.addPart(partDefinition);
}
}
}
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:JSNativePerspective.java
示例3: getFirstUnselectablePartTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void getFirstUnselectablePartTest() {
PartDefinition part1 = new PartDefinitionImpl(mock(PlaceRequest.class));
part1.setSelectable(false);
PartDefinition part2 = new PartDefinitionImpl(mock(PlaceRequest.class));
part2.setSelectable(true);
PartDefinition part3 = new PartDefinitionImpl(mock(PlaceRequest.class));
part3.setSelectable(false);
LinkedHashSet<PartDefinition> parts = new LinkedHashSet<>();
parts.add(part1);
parts.add(part2);
parts.add(part3);
doReturn(parts).when(listBar).getUnselectedParts();
assertSame(part2, listBar.getNextPart(part1));
assertSame(part1, listBar.getNextPart(part2));
assertSame(part2, listBar.getNextPart(part3));
}
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:ListBarWidgetImplTest.java
示例4: createPartDefinitions
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
private void createPartDefinitions() {
partDefinitionsRoot = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1")),
new PartDefinitionImpl(new DefaultPlaceRequest("part2")));
partDefinitionRootChild1 = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild1")),
new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild1")),
new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild1")));
partDefinitionRootChild2 = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild2")),
new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild2")),
new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild2")));
partDefinitionRootChild2Child = Arrays.asList(new PartDefinitionImpl(new DefaultPlaceRequest("part1-rootChild2Child")),
new PartDefinitionImpl(new DefaultPlaceRequest("part2-rootChild2Child")),
new PartDefinitionImpl(new DefaultPlaceRequest("part3-rootChild2Child")),
new PartDefinitionImpl(new DefaultPlaceRequest("part4-rootChild2Child")));
}
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PerspectiveManagerTest.java
示例5: removeContainedPart
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void removeContainedPart() {
WorkbenchPartPresenter mockPresenter = mock(WorkbenchPartPresenter.class);
WorkbenchPartPresenter.View mockPartView = mock(WorkbenchPartPresenter.View.class);
PartDefinition mockPartDefinition = new PartDefinitionImpl(new DefaultPlaceRequest("mockPlace"));
when(mockPartView.getPresenter()).thenReturn(mockPresenter);
when(mockPresenter.getDefinition()).thenReturn(mockPartDefinition);
when(view.panel.getPartView()).thenReturn(null);
view.addPart(mockPartView);
when(view.panel.getPartView()).thenReturn(mockPartView);
boolean removed = view.removePart(mockPartDefinition);
assertTrue(removed);
verify(panel).clear();
}
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:StaticWorkbenchPanelViewTest.java
示例6: removeNonContainedPart
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void removeNonContainedPart() {
WorkbenchPartPresenter mockPresenter = mock(WorkbenchPartPresenter.class);
WorkbenchPartPresenter.View mockPartView = mock(WorkbenchPartPresenter.View.class);
PartDefinition mockPartDefinition = new PartDefinitionImpl(new DefaultPlaceRequest("mock1"));
when(mockPartView.getPresenter()).thenReturn(mockPresenter);
when(mockPresenter.getDefinition()).thenReturn(mockPartDefinition);
WorkbenchPartPresenter mockPresenter2 = mock(WorkbenchPartPresenter.class);
WorkbenchPartPresenter.View mockPartView2 = mock(WorkbenchPartPresenter.View.class);
PartDefinition mockPartDefinition2 = new PartDefinitionImpl(new DefaultPlaceRequest("mock2"));
when(mockPartView2.getPresenter()).thenReturn(mockPresenter2);
when(mockPresenter2.getDefinition()).thenReturn(mockPartDefinition2);
when(view.panel.getPartView()).thenReturn(null);
view.addPart(mockPartView);
when(view.panel.getPartView()).thenReturn(mockPartView);
boolean removed = view.removePart(mockPartDefinition2);
assertFalse(removed);
verify(panel,
never()).clear();
}
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:StaticWorkbenchPanelViewTest.java
示例7: unknownPartsShouldResolveToPanelContextWhenThereIsOne
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
/**
* If there is a panel context, it overrides the perspective context.
*/
@Test
public void unknownPartsShouldResolveToPanelContextWhenThereIsOne() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
ContextDefinition panelContextDefinition = new ContextDefinitionImpl(new DefaultPlaceRequest("panelDefinition"));
ContextActivity panelContextActivity = mock(ContextActivity.class);
when(mockActivityManager.getActivity(ContextActivity.class,
new DefaultPlaceRequest("panelDefinition"))).thenReturn(panelContextActivity);
panelPresenterPanelDefinition.setContextDefinition(panelContextDefinition);
presenter.setDefinition(panelPresenterPanelDefinition);
final ContextActivity resolvedContextActivity = presenter.resolveContext(new PartDefinitionImpl(new DefaultPlaceRequest("randomUnknownPlace")));
assertSame(panelContextActivity,
resolvedContextActivity);
}
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:AbstractMultiPartWorkbenchPanelPresenterTest.java
示例8: getPerspective
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Perspective
public PerspectiveDefinition getPerspective() {
final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl( MultiListWorkbenchPanelPresenter.class.getName() );
perspective.setName( constants.administration() );
perspective.getRoot().addPart( new PartDefinitionImpl( new DefaultPlaceRequest( "RepositoriesEditor" ) ) );
final PanelDefinition west = new PanelDefinitionImpl( SimpleWorkbenchPanelPresenter.class.getName() );
west.setWidth( 300 );
west.setMinWidth( 200 );
west.addPart( new PartDefinitionImpl( new DefaultPlaceRequest( "FileExplorer" ) ) );
perspective.getRoot().insertChild( CompassPosition.WEST, west );
return perspective;
}
开发者ID:kiegroup,项目名称:kie-wb-distributions,代码行数:17,代码来源:AdministrationPerspective.java
示例9: getPerspective
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Perspective
public PerspectiveDefinition getPerspective() {
final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl( MultiListWorkbenchPanelPresenter.class.getName() );
perspective.setName( constants.Administration() );
perspective.getRoot().addPart( new PartDefinitionImpl( new DefaultPlaceRequest( "RepositoriesEditor" ) ) );
final PanelDefinition west = new PanelDefinitionImpl( SimpleWorkbenchPanelPresenter.class.getName() );
west.setWidth( 300 );
west.setMinWidth( 200 );
west.addPart( new PartDefinitionImpl( new DefaultPlaceRequest( "FileExplorer" ) ) );
perspective.getRoot().insertChild( CompassPosition.WEST, west );
return perspective;
}
开发者ID:kiegroup,项目名称:kie-wb-distributions,代码行数:17,代码来源:AdministrationPerspective.java
示例10: buildPerspective
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Perspective
public PerspectiveDefinition buildPerspective() {
final PerspectiveDefinition perspective = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
perspective.setName(AppConstants.INSTANCE.AdministrationPerspectiveName());
perspective.getRoot().addPart(new PartDefinitionImpl(new DefaultPlaceRequest("RepositoriesEditor")));
final PanelDefinition west = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
west.setWidth(300);
west.setMinWidth(200);
west.addPart(new PartDefinitionImpl(new DefaultPlaceRequest("FileExplorer")));
perspective.getRoot().insertChild(CompassPosition.WEST,
west);
return perspective;
}
开发者ID:kiegroup,项目名称:drools-wb,代码行数:18,代码来源:AdministrationPerspective.java
示例11: setupLibraryPerspective
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
private void setupLibraryPerspective() {
OrganizationalUnit activeOu = projectContext.getActiveOrganizationalUnit()
.orElseThrow(() -> new IllegalStateException("Cannot setup library perspective without active organizational unit."));
PortablePreconditions.checkNotNull("libraryPerspective",
libraryPerspective);
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
if (!projectContext.getActiveWorkspaceProject().isPresent()) {
projectContextChangeEvent.fire(new WorkspaceProjectContextChangeEvent(activeOu));
}
closeLibraryPlaces();
placeManager.goTo(part,
libraryPerspective.getRootPanel());
setupLibraryBreadCrumbsWithoutProject();
hideDocks();
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:23,代码来源:LibraryPlaces.java
示例12: goToImportProjects
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
public void goToImportProjects(final String repositoryUrl) {
if (closeAllPlacesOrNothing()) {
Map<String, String> params = new HashMap<>();
params.put("title",
ts.getTranslation(LibraryConstants.ImportProjects));
if (repositoryUrl != null) {
params.put("repositoryUrl",
repositoryUrl);
}
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.IMPORT_PROJECTS_SCREEN,
params);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
placeManager.goTo(part,
libraryPerspective.getRootPanel());
setupLibraryBreadCrumbsForImportProjects(repositoryUrl);
}
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:LibraryPlaces.java
示例13: goToPreferences
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
public void goToPreferences() {
final PreferenceScopeResolutionStrategyInfo customScopeResolutionStrategy = projectScopedResolutionStrategySupplier.get();
final PreferencesCentralInitializationEvent initEvent = new PreferencesCentralInitializationEvent("ProjectPreferences",
customScopeResolutionStrategy,
null);
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PreferencesRootScreen.IDENTIFIER);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
placeManager.goTo(part,
libraryPerspective.getRootPanel());
preferencesCentralInitializationEvent.fire(initEvent);
setupLibraryBreadCrumbsForPreferences();
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:LibraryPlaces.java
示例14: goToOrganizationalUnitsTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToOrganizationalUnitsTest() {
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.ORGANIZATIONAL_UNITS_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToOrganizationalUnits();
verify(projectContextChangeEvent).fire(projectContextChangeEventArgumentCaptor.capture());
assertNull(projectContextChangeEventArgumentCaptor.getValue().getOrganizationalUnit());
final ArgumentCaptor<WorkspaceProjectContextChangeEvent> eventArgumentCaptor = ArgumentCaptor.forClass(WorkspaceProjectContextChangeEvent.class);
verify(projectContextChangeEvent).fire(eventArgumentCaptor.capture());
final WorkspaceProjectContextChangeEvent event = eventArgumentCaptor.getValue();
assertNull(event.getOrganizationalUnit());
assertNull(event.getWorkspaceProject());
verify(placeManager).closeAllPlacesOrNothing();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbs();
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:LibraryPlacesTest.java
示例15: goToLibraryWithDefaultOrganizationalUnitTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToLibraryWithDefaultOrganizationalUnitTest() {
when(projectContext.getActiveOrganizationalUnit()).thenReturn(Optional.empty())
.thenReturn(Optional.of(mock(OrganizationalUnit.class)));
doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.empty()).when(projectContext).getActiveModule();
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToLibrary();
verify(libraryPlaces).closeLibraryPlaces();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
verify(projectContextChangeEvent,
times(2)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:21,代码来源:LibraryPlacesTest.java
示例16: goToLibraryFromOrganizationalUnitsScreenTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToLibraryFromOrganizationalUnitsScreenTest() {
doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
doReturn(Optional.empty()).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.empty()).when(projectContext).getActiveModule();
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToLibrary();
verify(libraryPlaces).closeLibraryPlaces();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
verify(projectContextChangeEvent,
times(1)).fire(any(WorkspaceProjectContextChangeEvent.class));
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:LibraryPlacesTest.java
示例17: goToLibraryWhenGoingBackFromProjectTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToLibraryWhenGoingBackFromProjectTest() {
doReturn(Optional.of(activeOrganizationalUnit)).when(projectContext).getActiveOrganizationalUnit();
activeProject = new WorkspaceProject(activeOrganizationalUnit,
activeRepository,
activeBranch,
activeModule);
doReturn(Optional.of(activeProject)).when(projectContext).getActiveWorkspaceProject();
doReturn(Optional.of(activeModule)).when(projectContext).getActiveModule();
final PlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.LIBRARY_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToLibrary();
verify(libraryPlaces).closeLibraryPlaces();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsWithoutProject();
verify(projectContextChangeEvent,
never()).fire(any(WorkspaceProjectContextChangeEvent.class));
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:24,代码来源:LibraryPlacesTest.java
示例18: goToTrySamplesTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToTrySamplesTest() {
doReturn(true).when(libraryPlaces).closeAllPlacesOrNothing();
Map<String, String> params = new HashMap<>();
params.put("trySamples",
"true");
final PlaceRequest trySamplesScreen = new DefaultPlaceRequest(LibraryPlaces.IMPORT_PROJECTS_SCREEN,
params);
final PartDefinitionImpl part = new PartDefinitionImpl(trySamplesScreen);
part.setSelectable(false);
libraryPlaces.goToTrySamples();
verify(libraryPlaces).closeAllPlacesOrNothing();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsForTrySamples();
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:LibraryPlacesTest.java
示例19: goToImportProjectsTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToImportProjectsTest() {
doReturn(true).when(libraryPlaces).closeAllPlacesOrNothing();
Map<String, String> params = new HashMap<>();
params.put("title",
null);
params.put("repositoryUrl",
"repositoryUrl");
final PlaceRequest importProjectsScreen = new DefaultPlaceRequest(LibraryPlaces.IMPORT_PROJECTS_SCREEN,
params);
final PartDefinitionImpl part = new PartDefinitionImpl(importProjectsScreen);
part.setSelectable(false);
libraryPlaces.goToImportProjects("repositoryUrl");
verify(libraryPlaces).closeAllPlacesOrNothing();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(libraryPlaces).setupLibraryBreadCrumbsForImportProjects("repositoryUrl");
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:LibraryPlacesTest.java
示例20: goToPreferencesTest
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入依赖的package包/类
@Test
public void goToPreferencesTest() {
final PreferenceScopeResolutionStrategyInfo scopeResolutionStrategyInfo = mock(PreferenceScopeResolutionStrategyInfo.class);
doReturn(scopeResolutionStrategyInfo).when(projectScopedResolutionStrategySupplier).get();
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(PreferencesRootScreen.IDENTIFIER);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
libraryPlaces.goToPreferences();
verify(placeManager).goTo(eq(part),
any(PanelDefinition.class));
verify(preferencesCentralInitializationEvent).fire(new PreferencesCentralInitializationEvent("ProjectPreferences",
scopeResolutionStrategyInfo,
null));
verify(libraryPlaces).setupLibraryBreadCrumbsForPreferences();
}
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:LibraryPlacesTest.java
注:本文中的org.uberfire.workbench.model.impl.PartDefinitionImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论