本文整理汇总了Java中org.uberfire.workbench.model.impl.PartDefinitionImpl.setSelectable方法的典型用法代码示例。如果您正苦于以下问题:Java PartDefinitionImpl.setSelectable方法的具体用法?Java PartDefinitionImpl.setSelectable怎么用?Java PartDefinitionImpl.setSelectable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.uberfire.workbench.model.impl.PartDefinitionImpl
的用法示例。
在下文中一共展示了PartDefinitionImpl.setSelectable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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);
}
}
示例3: 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();
}
示例4: 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();
}
示例5: 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));
}
示例6: 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));
}
示例7: 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));
}
示例8: 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();
}
示例9: 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");
}
示例10: 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();
}
示例11: resizePanelBodyForUnselectablePart
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入方法依赖的package包/类
@Test
public void resizePanelBodyForUnselectablePart() {
final PartDefinitionImpl partDefinition = new PartDefinitionImpl(mock(PlaceRequest.class));
partDefinition.setSelectable(false);
listBar.currentPart = new Pair<>(partDefinition,
mock(FlowPanel.class));
listBar.resizePanelBody();
verify(listBar.content.getElement().getStyle()).setProperty("height",
"100%");
}
示例12: resizePanelBodyForSelectablePart
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入方法依赖的package包/类
@Test
public void resizePanelBodyForSelectablePart() {
final PartDefinitionImpl partDefinition = new PartDefinitionImpl(mock(PlaceRequest.class));
partDefinition.setSelectable(true);
listBar.currentPart = new Pair<>(partDefinition,
mock(FlowPanel.class));
doReturn(10).when(listBar.header).getOffsetHeight();
listBar.resizePanelBody();
verify(listBar.content.getElement().getStyle()).setProperty("height",
"calc(100% - 10px)");
}
示例13: goToOrganizationalUnits
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入方法依赖的package包/类
public void goToOrganizationalUnits() {
if (closeAllPlacesOrNothing()) {
PortablePreconditions.checkNotNull("libraryPerspective.closeAllPlacesOrNothing",
libraryPerspective);
projectContextChangeEvent.fire(new WorkspaceProjectContextChangeEvent());
final DefaultPlaceRequest placeRequest = new DefaultPlaceRequest(LibraryPlaces.ORGANIZATIONAL_UNITS_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(placeRequest);
part.setSelectable(false);
placeManager.goTo(part,
libraryPerspective.getRootPanel());
setupLibraryBreadCrumbs();
}
}
示例14: goToProject
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入方法依赖的package包/类
private void goToProject(final Command callback) {
setupLibraryBreadCrumbs(projectContext.getActiveWorkspaceProject()
.orElseThrow(() -> new IllegalStateException("Cannot go to project when no project is active.")));
final PartDefinitionImpl part = new PartDefinitionImpl(new DefaultPlaceRequest(LibraryPlaces.PROJECT_SCREEN));
part.setSelectable(false);
placeManager.goTo(part,
libraryPerspective.getRootPanel());
if (callback != null) {
callback.execute();
}
}
示例15: goToOrgUnitsMetrics
import org.uberfire.workbench.model.impl.PartDefinitionImpl; //导入方法依赖的package包/类
public void goToOrgUnitsMetrics() {
final PlaceRequest metricsScreen = new DefaultPlaceRequest(LibraryPlaces.ORG_UNITS_METRICS_SCREEN);
final PartDefinitionImpl part = new PartDefinitionImpl(metricsScreen);
part.setSelectable(false);
placeManager.goTo(part,
libraryPerspective.getRootPanel());
setupLibraryBreadCrumbsForOrgUnitsMetrics();
}