本文整理汇总了Java中org.uberfire.workbench.model.impl.PanelDefinitionImpl类的典型用法代码示例。如果您正苦于以下问题:Java PanelDefinitionImpl类的具体用法?Java PanelDefinitionImpl怎么用?Java PanelDefinitionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PanelDefinitionImpl类属于org.uberfire.workbench.model.impl包,在下文中一共展示了PanelDefinitionImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildPerspective
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的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;
}
示例2: addWorkbenchPanel
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Override
public PanelDefinition addWorkbenchPanel(final PanelDefinition targetPanel,
final Position position,
final Integer height,
final Integer width,
final Integer minHeight,
final Integer minWidth) {
final PanelDefinitionImpl childPanel = new PanelDefinitionImpl(PanelDefinition.PARENT_CHOOSES_TYPE);
childPanel.setHeight(height);
childPanel.setWidth(width);
childPanel.setMinHeight(minHeight);
childPanel.setMinWidth(minWidth);
return addWorkbenchPanel(targetPanel,
childPanel,
position);
}
示例3: createPerspectiveDefinition
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
private PerspectiveDefinition createPerspectiveDefinition() {
PerspectiveDefinitionImpl perspectiveDefinition = new PerspectiveDefinitionImpl();
PanelDefinition root = perspectiveDefinition.getRoot();
partDefinitionsRoot.forEach(p -> root.addPart(p));
PanelDefinitionImpl rootChild1 = new PanelDefinitionImpl("org.uberfire.client.workbench.panels.impl.MultiTabWorkbenchPanelPresenter");
partDefinitionRootChild1.forEach(p -> rootChild1.addPart(p));
PanelDefinitionImpl rootChild2 = new PanelDefinitionImpl("org.uberfire.client.workbench.panels.impl.MultiTabWorkbenchPanelPresenter");
partDefinitionRootChild2.forEach(p -> rootChild2.addPart(p));
PanelDefinitionImpl rootChild2Child = new PanelDefinitionImpl("org.uberfire.client.workbench.panels.impl.MultiTabWorkbenchPanelPresenter");
partDefinitionRootChild2Child.forEach(p -> rootChild2Child.addPart(p));
root.insertChild(mock(Position.class),
rootChild1);
rootChild2.insertChild(mock(Position.class),
rootChild2Child);
root.insertChild(mock(Position.class),
rootChild2);
return perspectiveDefinition;
}
示例4: addedChildPanelsShouldBeRemembered
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void addedChildPanelsShouldBeRemembered() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
PanelDefinitionImpl childPanelDef = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
WorkbenchPanelPresenter childPanelPresenter = mock(WorkbenchPanelPresenter.class);
when(childPanelPresenter.getDefinition()).thenReturn(childPanelDef);
WorkbenchPanelView<WorkbenchPanelPresenter> childPanelView = mock(WorkbenchPanelView.class);
when(childPanelView.getPresenter()).thenReturn(childPanelPresenter);
presenter.addPanel(childPanelPresenter,
CompassPosition.NORTH);
assertSame(childPanelPresenter,
presenter.getPanels().get(CompassPosition.NORTH));
assertEquals(childPanelDef,
presenter.getDefinition().getChild(CompassPosition.NORTH));
}
示例5: removedChildPanelsShouldBeForgotten
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void removedChildPanelsShouldBeForgotten() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
PanelDefinitionImpl childPanelDef = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
WorkbenchPanelPresenter childPanelPresenter = mock(WorkbenchPanelPresenter.class);
when(childPanelPresenter.getDefinition()).thenReturn(childPanelDef);
WorkbenchPanelView<WorkbenchPanelPresenter> childPanelView = mock(WorkbenchPanelView.class);
when(childPanelView.getPresenter()).thenReturn(childPanelPresenter);
presenter.addPanel(childPanelPresenter,
CompassPosition.NORTH);
boolean removed = presenter.removePanel(childPanelPresenter);
assertTrue(removed);
assertNull(presenter.getPanels().get(CompassPosition.NORTH));
assertNull(presenter.getDefinition().getChild(CompassPosition.NORTH));
}
示例6: addingChildPanelShouldUpdateParentPointers
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void addingChildPanelShouldUpdateParentPointers() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
PanelDefinitionImpl childPanelDef = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
WorkbenchPanelPresenter childPanelPresenter = mock(WorkbenchPanelPresenter.class);
when(childPanelPresenter.getDefinition()).thenReturn(childPanelDef);
WorkbenchPanelView<WorkbenchPanelPresenter> childPanelView = mock(WorkbenchPanelView.class);
when(childPanelView.getPresenter()).thenReturn(childPanelPresenter);
presenter.addPanel(childPanelPresenter,
CompassPosition.NORTH);
verify(childPanelPresenter).setParent(presenter);
assertSame(presenter.getDefinition(),
childPanelDef.getParent());
}
示例7: removingChildPanelShouldClearParentPointers
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Test
public void removingChildPanelShouldClearParentPointers() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
PanelDefinitionImpl childPanelDef = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
WorkbenchPanelPresenter childPanelPresenter = mock(WorkbenchPanelPresenter.class);
WorkbenchPanelView<WorkbenchPanelPresenter> childPanelView = mock(WorkbenchPanelView.class);
when(childPanelView.getPresenter()).thenReturn(childPanelPresenter);
presenter.addPanel(childPanelPresenter,
CompassPosition.NORTH);
presenter.removePanel(childPanelPresenter);
verify(childPanelPresenter).setParent(null);
assertNull(childPanelDef.getParent());
}
示例8: removingUnknownPanelShouldNotAffectExistingOnes
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Test
public void removingUnknownPanelShouldNotAffectExistingOnes() throws Exception {
AbstractMultiPartWorkbenchPanelPresenter<?> presenter = getPresenterToTest();
PanelDefinitionImpl childPanelDef = new PanelDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
WorkbenchPanelPresenter childPanelPresenter = mock(WorkbenchPanelPresenter.class);
when(childPanelPresenter.getDefinition()).thenReturn(childPanelDef);
WorkbenchPanelView<WorkbenchPanelPresenter> childPanelView = mock(WorkbenchPanelView.class);
when(childPanelView.getPresenter()).thenReturn(childPanelPresenter);
WorkbenchPanelPresenter unknownPanelPresenter = mock(WorkbenchPanelPresenter.class);
presenter.addPanel(childPanelPresenter,
CompassPosition.NORTH);
boolean removed = presenter.removePanel(unknownPanelPresenter);
assertFalse(removed);
assertSame(childPanelPresenter,
presenter.getPanels().get(CompassPosition.NORTH));
assertEquals(childPanelDef,
presenter.getDefinition().getChild(CompassPosition.NORTH));
verify(childPanelPresenter,
never()).setParent(null);
}
示例9: addPartTwiceShouldCloseOtherPartTest
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Test
public void addPartTwiceShouldCloseOtherPartTest() {
SinglePartPanelHelper singlePartPanelHelper = mock(SinglePartPanelHelper.class);
StaticWorkbenchPanelPresenter presenter = new StaticWorkbenchPanelPresenter(view,
mock(PerspectiveManager.class),
placeManager) {
SinglePartPanelHelper createSinglePartPanelHelper() {
return singlePartPanelHelper;
}
};
presenter.init();
presenter.setDefinition(new PanelDefinitionImpl());
//there is already a part
when(singlePartPanelHelper.hasNoParts()).thenReturn(false);
WorkbenchPartPresenter part2 = mock(WorkbenchPartPresenter.class);
when(part2.getDefinition()).thenReturn(mock(PartDefinition.class));
presenter.addPart(part2);
verify(singlePartPanelHelper).closeFirstPartAndAddNewOne(any(Command.class));
}
示例10: addPartTwiceShouldCloseOtherPartTest
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Test
public void addPartTwiceShouldCloseOtherPartTest() {
SinglePartPanelHelper singlePartPanelHelper = mock(SinglePartPanelHelper.class);
UnanchoredStaticWorkbenchPanelPresenter presenter = new UnanchoredStaticWorkbenchPanelPresenter(view,
mock(PerspectiveManager.class),
placeManager) {
SinglePartPanelHelper createSinglePartPanelHelper() {
return singlePartPanelHelper;
}
};
presenter.init();
presenter.setDefinition(new PanelDefinitionImpl());
//there is already a part
when(singlePartPanelHelper.hasNoParts()).thenReturn(false);
WorkbenchPartPresenter part2 = mock(WorkbenchPartPresenter.class);
when(part2.getDefinition()).thenReturn(mock(PartDefinition.class));
presenter.addPart(part2);
verify(singlePartPanelHelper).closeFirstPartAndAddNewOne(any(Command.class));
}
示例11: addPartTwiceShouldCloseOtherPartTest
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Test
public void addPartTwiceShouldCloseOtherPartTest() {
SinglePartPanelHelper singlePartPanelHelper = mock(SinglePartPanelHelper.class);
presenter = new SimpleDnDWorkbenchPanelPresenter(view,
mock(PerspectiveManager.class),
placeManager) {
SinglePartPanelHelper createSinglePartPanelHelper() {
return singlePartPanelHelper;
}
};
presenter.init();
presenter.setDefinition(new PanelDefinitionImpl());
//there is already a part
when(singlePartPanelHelper.hasNoParts()).thenReturn(false);
WorkbenchPartPresenter part2 = mock(WorkbenchPartPresenter.class);
when(part2.getDefinition()).thenReturn(mock(PartDefinition.class));
presenter.addPart(part2);
verify(singlePartPanelHelper).closeFirstPartAndAddNewOne(any(Command.class));
}
示例12: addPanelAtRootPositionShouldReturnRootPanel
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Test
public void addPanelAtRootPositionShouldReturnRootPanel() throws Exception {
when(beanFactory.newRootPanel(any(PerspectiveActivity.class),
eq(testPerspectiveDef.getRoot()))).thenReturn(testPerspectiveRootPanelPresenter);
when(testPerspectiveRootPanelPresenter.getDefaultChildType()).thenReturn(null);
PerspectiveActivity testPerspectiveActivity = mock(PerspectiveActivity.class);
panelManager.setRoot(testPerspectiveActivity,
testPerspectiveDef.getRoot());
PanelDefinition notActuallyAdded = new PanelDefinitionImpl(SimpleWorkbenchPanelPresenter.class.getName());
PanelDefinition result = panelManager.addWorkbenchPanel(testPerspectiveDef.getRoot(),
notActuallyAdded,
CompassPosition.ROOT);
assertSame(result,
testPerspectiveDef.getRoot());
}
示例13: getDefaultPerspectiveLayout
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Override
public PerspectiveDefinition getDefaultPerspectiveLayout() {
PerspectiveDefinition def = new PerspectiveDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
def.getRoot().addPart(ResizeTestScreenActivity.class.getName());
PanelDefinition southPanel = new PanelDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
southPanel.addPart(DragAndDropScreen.class.getName());
def.getRoot().appendChild(CompassPosition.SOUTH,
southPanel);
PanelDefinition eastPanel = new PanelDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
eastPanel.addPart(NestingScreen.class.getName());
def.getRoot().appendChild(CompassPosition.EAST,
eastPanel);
return def;
}
示例14: getDefaultPerspectiveLayout
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Override
public PerspectiveDefinition getDefaultPerspectiveLayout() {
PerspectiveDefinition def = new PerspectiveDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
def.getRoot().addPart(ResizeTestScreenActivity.class.getName());
PanelDefinition southPanel = new PanelDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
southPanel.addPart(ResizeTestScreenActivity.class.getName() + "?debugId=south");
def.getRoot().appendChild(CompassPosition.SOUTH,
southPanel);
PanelDefinition westPanel = new PanelDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
westPanel.addPart(ResizeTestScreenActivity.class.getName() + "?debugId=west");
westPanel.setMinWidth(250);
westPanel.setWidth(300);
def.getRoot().appendChild(CompassPosition.WEST,
westPanel);
return def;
}
示例15: getDefaultPerspectiveLayout
import org.uberfire.workbench.model.impl.PanelDefinitionImpl; //导入依赖的package包/类
@Override
public PerspectiveDefinition getDefaultPerspectiveLayout() {
PerspectiveDefinition pd = new PerspectiveDefinitionImpl(MultiListWorkbenchPanelPresenter.class.getName());
pd.getRoot().setElementId("DragAndDropPerspective-list");
pd.getRoot().addPart(DragAndDropScreen.class.getName() + "?debugId=1");
pd.getRoot().addPart(DragAndDropScreen.class.getName() + "?debugId=2");
PanelDefinitionImpl tabPanel = new PanelDefinitionImpl(MultiTabWorkbenchPanelPresenter.class.getName());
tabPanel.setElementId("DragAndDropPerspective-tab");
tabPanel.setWidth(300);
tabPanel.addPart(DragAndDropScreen.class.getName() + "?debugId=3");
tabPanel.addPart(DragAndDropScreen.class.getName() + "?debugId=4");
pd.getRoot().appendChild(CompassPosition.WEST,
tabPanel);
PanelDefinitionImpl simplePanel = new PanelDefinitionImpl(SimpleDnDWorkbenchPanelPresenter.class.getName());
simplePanel.setWidth(175);
simplePanel.setElementId("DragAndDropPerspective-simple");
simplePanel.addPart(DragAndDropScreen.class.getName() + "?debugId=5");
pd.getRoot().appendChild(CompassPosition.EAST,
simplePanel);
return pd;
}