• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PanelDefinition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.uberfire.workbench.model.PanelDefinition的典型用法代码示例。如果您正苦于以下问题:Java PanelDefinition类的具体用法?Java PanelDefinition怎么用?Java PanelDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PanelDefinition类属于org.uberfire.workbench.model包,在下文中一共展示了PanelDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: buildPerspective

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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: createPerspectiveDefinition

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:PerspectiveManagerTest.java


示例3: insertChild

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Override
public void insertChild(final Position position,
                        final PanelDefinition panel) {
    if (panel == null) {
        return;
    }
    if (children.contains(panel)) {
        return;
    }

    // parent wiring
    ((PanelDefinitionImpl) panel).setParent(this);

    checkPosition(position);
    panel.setPosition(position);
    final PanelDefinition existingChild = getChild(position);
    if (existingChild == null) {
        children.add(panel);
    } else {
        removeChild(position);
        children.add(panel);
        panel.insertChild(position,
                          existingChild);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:PanelDefinitionImpl.java


示例4: appendChild

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Override
public void appendChild(final Position position,
                        final PanelDefinition panel) {

    if (panel == null) {
        return;
    }
    if (children.contains(panel)) {
        return;
    }
    checkPosition(position);
    panel.setPosition(position);
    final PanelDefinition existingChild = getChild(position);
    if (existingChild == null) {

        // parent wiring
        ((PanelDefinitionImpl) panel).setParent(this);

        children.add(panel);
    } else {
        existingChild.appendChild(position,
                                  panel);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:PanelDefinitionImpl.java


示例5: testProperSplashScreenShutdownOnPartClose

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Test
public void testProperSplashScreenShutdownOnPartClose() throws Exception {
    PlaceRequest oz = new DefaultPlaceRequest("oz");
    WorkbenchScreenActivity ozActivity = mock(WorkbenchScreenActivity.class);
    when(activityManager.getActivities(oz)).thenReturn(singleton((Activity) ozActivity));

    final SplashScreenActivity lollipopGuildActivity = mock(SplashScreenActivity.class);
    when(lollipopGuildActivity.isType(ActivityResourceType.SPLASH.name())).thenReturn(true);
    when(activityManager.getSplashScreenInterceptor(oz)).thenReturn(lollipopGuildActivity);
    when(ozActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);

    placeManager.goTo(oz,
                      (PanelDefinition) null);
    placeManager.closePlace(oz);

    assertTrue(placeManager.getActiveSplashScreens().isEmpty());
    verify(lollipopGuildActivity).closeIfOpen();

    // splash screens are Application Scoped, but we still "destroy" them (activity manager will call their onShutdown)
    verify(activityManager).destroyActivity(lollipopGuildActivity);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:PlaceManagerTest.java


示例6: buildParts

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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


示例7: onDropHappens

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Test
public void onDropHappens() {
    compassDropController.mockDropTargetPosition(CompassPosition.WEST);

    compassDropController.mockSamePositionDrag(view);

    DragContext dragContext = mock(DragContext.class);

    compassDropController.onDrop(dragContext);

    verify(panelManager).addWorkbenchPanel(any(PanelDefinition.class),
                                           any(Position.class),
                                           any(Integer.class),
                                           any(Integer.class),
                                           any(Integer.class),
                                           any(Integer.class));

    verify(panelManager).addWorkbenchPart(any(PlaceRequest.class),
                                          any(PartDefinition.class),
                                          any(PanelDefinition.class),
                                          any(Menus.class),
                                          any(UIPart.class),
                                          any(String.class),
                                          isNull(Integer.class),
                                          isNull(Integer.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:CompassDropControllerTest.java


示例8: goTo

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Override
public void goTo(final PartDefinition part,
                 final PanelDefinition panel) {
    final PlaceRequest place = part.getPlace();
    if (place == null) {
        return;
    }
    final ResolvedRequest resolved = resolveActivity(place);

    if (resolved.getActivity() != null) {
        final Activity activity = resolved.getActivity();

        if (activity.isType(ActivityResourceType.EDITOR.name()) || activity.isType(ActivityResourceType.SCREEN.name())) {
            final WorkbenchActivity workbenchActivity = (WorkbenchActivity) activity;
            launchWorkbenchActivityInPanel(place,
                                           workbenchActivity,
                                           part,
                                           panel);
        } else {
            throw new IllegalArgumentException("placeRequest does not represent a WorkbenchActivity. Only WorkbenchActivities can be launched in a specific targetPanel.");
        }
    } else {
        goTo(resolved.getPlaceRequest());
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:PlaceManagerImpl.java


示例9: testGoToNewPlaceById

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Test
public void testGoToNewPlaceById() throws Exception {
    PlaceRequest oz = new DefaultPlaceRequest("oz");
    WorkbenchScreenActivity ozActivity = mock(WorkbenchScreenActivity.class);
    when(ozActivity.isType(ActivityResourceType.SCREEN.name())).thenReturn(true);
    when(ozActivity.isDynamic()).thenReturn(false);
    when(ozActivity.preferredWidth()).thenReturn(-1);
    when(ozActivity.preferredHeight()).thenReturn(-1);
    when(activityManager.getActivities(oz)).thenReturn(singleton((Activity) ozActivity));

    placeManager.goTo(oz,
                      (PanelDefinition) null);

    verifyActivityLaunchSideEffects(oz,
                                    ozActivity,
                                    null);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PlaceManagerTest.java


示例10: addPanel

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Override
public void addPanel(PanelDefinition panel,
                     WorkbenchPanelView<?> view,
                     Position p) {
    NamedPosition position = (NamedPosition) p;
    HTMLElement panelContainer = activity.resolvePosition(position);

    if (panelContainer.hasChildNodes()) {
        throw new IllegalStateException("Child position " + position + " is already occupied");
    }

    DOMUtil.appendWidgetToElement(panelContainer,
                                  view.asWidget());
    childPanelPositions.put(view,
                            position);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:TemplatedWorkbenchPanelView.java


示例11: getDefaultPerspectiveLayout

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:NonTransientMultiPanelPerspective.java


示例12: initialWidthOrHeight

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
/**
 * Retrieves the application-requested initial size for a child panel, or calculates a good default based on the
 * available space.
 *
 * @param position   the position the panel will be added within its parent.
 * @param definition the new panel's definition.
 * @param parent     the widget whose space will be used up by the insertion of the new panel.
 */
static int initialWidthOrHeight(CompassPosition position,
                                PanelDefinition definition,
                                Widget parent) {
    Integer requestedSize;
    int availableSize;
    switch (position) {
        case NORTH:
        case SOUTH:
            requestedSize = definition.getHeight();
            availableSize = parent.getOffsetHeight();
            break;
        case EAST:
        case WEST:
            requestedSize = definition.getWidth();
            availableSize = parent.getOffsetWidth();
            break;
        default:
            throw new IllegalArgumentException("Position " + position + " has no horizontal or vertial aspect.");
    }
    if (requestedSize == null || requestedSize <= 0) {
        return availableSize / 2;
    } else {
        return requestedSize;
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:34,代码来源:AbstractDockingWorkbenchPanelView.java


示例13: setup

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Before
public void setup() {
    perspectiveDef = new PerspectiveDefinitionImpl();

    when(panelManager.getRoot()).thenReturn(mock(PanelDefinition.class));

    doAnswer(new Answer<Object>() {
        @SuppressWarnings("rawtypes")
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ((ParameterizedCommand) invocation.getArguments()[1]).execute(perspectiveDef);
            return null;
        }
    }).when(wbServices).loadPerspective(any(String.class),
                                        any(ParameterizedCommand.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:AbstractPerspectiveActivityTest.java


示例14: onDropNoEffect

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Test
public void onDropNoEffect() {
    compassDropController.mockDropTargetPosition(CompassPosition.SELF);

    compassDropController.mockSamePositionDrag(view);

    DragContext dragContext = mock(DragContext.class);

    compassDropController.onDrop(dragContext);

    verify(panelManager,
           never()).addWorkbenchPanel(any(PanelDefinition.class),
                                      any(Position.class),
                                      any(Integer.class),
                                      any(Integer.class),
                                      any(Integer.class),
                                      any(Integer.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:CompassDropControllerTest.java


示例15: getDefaultPerspectiveLayout

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:MultiPanelPerspective.java


示例16: getSaveCommand

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
protected Command getSaveCommand(final DisplayerEditorPopup displayerEditor, final String currentTitle) {
    return () -> {
        // On save
        perspectiveCoordinator.editOff();
        DisplayerSettings newSettings = displayerEditor.getDisplayerSettings();
        if (!displayerSettings.equals(newSettings)) {

            String newTitle = newSettings.getTitle();
            if (!currentTitle.equals(newTitle)) {
                changeTitleEvent.fire(new ChangeTitleWidgetEvent(placeRequest, newSettings.getTitle()));
            }

            PanelDefinition panelDefinition = panelManager.getPanelForPlace(placeRequest);
            beanManager.destroyBean(displayerEditor);
            placeManager.goTo(createPlaceRequest(newSettings), panelDefinition);
            placeManager.closePlace(placeRequest);
            perspectiveManager.savePerspectiveState(() -> {});
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:DisplayerScreenPresenter.java


示例17: WorkbenchDragContext

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
public WorkbenchDragContext(final PlaceRequest place,
                            final PartDefinition sourcePart,
                            final PanelDefinition sourcePanel,
                            final Menus menus,
                            final String title,
                            final IsWidget titleDecoration,
                            final IsWidget widget,
                            final String contextId,
                            final Integer height,
                            final Integer width,
                            final Integer minHeight,
                            final Integer minWidth) {
    this.place = place;
    this.sourcePart = sourcePart;
    this.sourcePanel = sourcePanel;
    this.menus = menus;
    this.uiPart = new UIPart(title,
                             titleDecoration,
                             widget);
    this.contextId = contextId;
    this.height = height;
    this.width = width;
    this.minHeight = minHeight;
    this.minWidth = minWidth;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:WorkbenchDragContext.java


示例18: addPanelAtRootPositionShouldReturnRootPanel

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:PanelManagerTest.java


示例19: removeWorkbenchPanel

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
@Override
public void removeWorkbenchPanel(final PanelDefinition toRemove) throws IllegalStateException {
    if (toRemove.isRoot()) {
        throw new IllegalArgumentException("The root panel cannot be removed. To replace it, call setRoot()");
    }
    if (!toRemove.getParts().isEmpty()) {
        throw new IllegalStateException("Panel still contains parts: " + toRemove.getParts());
    }

    final WorkbenchPanelPresenter presenterToRemove = mapPanelDefinitionToPresenter.remove(toRemove);
    if (presenterToRemove == null) {
        throw new IllegalArgumentException("Couldn't find panel to remove: " + toRemove);
    }

    removeWorkbenchPanelFromParent(toRemove,
                                   presenterToRemove);

    // we do this check last because some panel types (eg. docking panels) can "rescue" orphaned child panels
    // during the PanelPresenter.remove() call
    if (!toRemove.getChildren().isEmpty()) {
        throw new IllegalStateException("Panel still contains child panels: " + toRemove.getChildren());
    }

    getBeanFactory().destroy(presenterToRemove);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:PanelManagerImpl.java


示例20: removeWorkbenchPanelFromParent

import org.uberfire.workbench.model.PanelDefinition; //导入依赖的package包/类
private void removeWorkbenchPanelFromParent(final PanelDefinition toRemove,
                                            final WorkbenchPanelPresenter presenterToRemove) {
    HasWidgets customContainer = customPanels.remove(toRemove);
    if (customContainer != null) {
        customContainer.remove(presenterToRemove.getPanelView().asWidget());
    } else {
        HTMLElement customHTMLElementContainer = customPanelsInsideHTMLElements.remove(toRemove);
        if (customHTMLElementContainer != null) {
            DOMUtil.removeFromParent(presenterToRemove.getPanelView().asWidget());
        } else {
            final PanelDefinition parentDef = toRemove.getParent();
            final WorkbenchPanelPresenter parentPresenter = mapPanelDefinitionToPresenter.get(parentDef);
            if (parentPresenter == null) {
                throw new IllegalArgumentException("The given panel's parent could not be found");
            }

            parentPresenter.removePanel(presenterToRemove);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:PanelManagerImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BuildConfig类代码示例发布时间:2022-05-23
下一篇:
Java ILogger类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap