gpt4 book ai didi

org.uberfire.client.workbench.part.WorkbenchPartPresenter类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 13:17:05 28 4
gpt4 key购买 nike

本文整理了Java中org.uberfire.client.workbench.part.WorkbenchPartPresenter类的一些代码示例,展示了WorkbenchPartPresenter类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkbenchPartPresenter类的具体详情如下:
包路径:org.uberfire.client.workbench.part.WorkbenchPartPresenter
类名称:WorkbenchPartPresenter

WorkbenchPartPresenter介绍

暂无

代码示例

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

private TabPanelEntry getTab(int i) {
  return checkNotNull("part entry in map",
            partTabIndex.get(parts.get(i).getDefinition()));
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

@Override
public void addPart(final WorkbenchPartPresenter.View view) {
  final PartDefinition partDefinition = view.getPresenter().getDefinition();
  if (parts.containsKey(partDefinition) == false) {
    final MultiScreenView screen = multiScreenViews.get();
    screen.setContent(view);
    screen.setTitle(view.getPresenter().getTitle());
    if (view.getPresenter().getTitleDecoration() != null) {
      screen.setTitleWidget(view.getPresenter().getTitleDecoration());
    }
    if (parts.isEmpty() && partDefinition.getParentPanel().getPosition() == null) {
      screen.disableClose();
    }
    screen.setCloseHandler(() -> panelManager.closePart(partDefinition));
    Optional.ofNullable(view.getPresenter().getMenus())
        .ifPresent(menus -> menus.getItems().stream().map(menuBuilder)
            .forEachOrdered(e -> e.ifPresent(element -> screen.addMenus(element)))
    );
    content.appendChild(screen.getElement());
    parts.put(partDefinition,
         screen);
  }
  selectPart(partDefinition);
}

代码示例来源:origin: org.uberfire/uberfire-panel-manager-nswe

@Override
public WorkbenchPartPresenter newWorkbenchPart( final Menus menus,
                        final String title,
                        final IsWidget titleDecoration,
                        final PartDefinition definition ) {
  final WorkbenchPartPresenter part = iocManager.lookupBean( WorkbenchPartPresenter.class ).getInstance();
  part.setTitle( title );
  part.setMenus( menus );
  part.setTitleDecoration( titleDecoration );
  part.setDefinition( definition );
  return part;
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

public void addPart(final WorkbenchPartPresenter.View view) {
  final PartDefinition part = view.getPresenter().getDefinition();
  partView.put(part,
         view);
  buildWidgets(part,
         view.getPresenter().getTitle(),
         view.getPresenter().getTitleDecoration());
  if (partTitles.size() == 1) {
    selectPart(part);
  }
}

代码示例来源:origin: kiegroup/appformer

/**
 * Adds the given part to the view returned by {@link #getPanelView()}, ignoring the given {@code contextId}.
 * Subclasses that care about context id's will override this method.
 */
@Override
public void addPart(final WorkbenchPartPresenter part,
          final String contextId) {
  // special case: when new perspectives are being built up based on definitions,
  // our definition will already say it contains the given part! We should not try to add it again.
  Optional<PartDefinition> optional = definition.getParts().stream()
      .filter(partDefinition -> partDefinition.equals(part.getDefinition()))
      .findAny();
  if (!optional.isPresent()) {
    definition.addPart(part.getDefinition());
  }
  getPanelView().addPart(part.getPartView());
}

代码示例来源:origin: kiegroup/appformer

@Override
public void dragStart() {
  final WorkbenchPartPresenter.View sourceView = (WorkbenchPartPresenter.View) super.context.selectedWidgets.get(0);
  final PartDefinition sourcePart = sourceView.getPresenter().getDefinition();
  final PanelDefinition sourcePanel = sourceView.getPresenter().getDefinition().getParentPanel();
  final PlaceRequest place = sourcePart.getPlace();
  final String title = sourceView.getPresenter().getTitle();
  final IsWidget titleDecoration = sourceView.getPresenter().getTitleDecoration();
  final String contextId = sourceView.getPresenter().getContextId();
  final IsWidget widget = sourceView.getPresenter().getPartView().getWrappedWidget();
  final Integer height = toInteger(sourcePanel.getHeightAsInt());
  final Integer width = toInteger(sourcePanel.getWidthAsInt());
                                 sourcePart,
                                 sourcePanel,
                                 sourceView.getPresenter().getMenus(),
                                 title,
                                 titleDecoration,

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

@Override
public void addPart(final WorkbenchPartPresenter.View view) {
  if (!tabIndex.containsKey(view)) {
    final TabPanelEntry tab = tabPanel.addItem(view.getPresenter().getTitle(),
                          view.asWidget());
    resizeIfNeeded(view.asWidget());
    tabIndex.put(view,
           tab);
    tabInvertedIndex.put(tab,
               view);
    partTabIndex.put(view.getPresenter().getDefinition(),
             tab);
    dndManager.makeDraggable(view,
                 tab.getTabWidget());
    addCloseToTab(tab);
    parts.add(view.getPresenter());
    tabIndex.put(view,
           tab);
    updateDisplayedTabs();
  }
}

代码示例来源:origin: kiegroup/appformer

partDef,
                         panelPresenter.getPartType());
partPresenter.setWrappedWidget(uiPart.getWidget());
partPresenter.setContextId(contextId);
mapPartDefinitionToPresenter.put(partDef,
                 partPresenter);

代码示例来源:origin: kiegroup/appformer

@Override
public void addPart(final WorkbenchPartPresenter part,
          final String contextId) {
  super.addPart(part,
         contextId);
  final ContextDisplayMode perspectiveContextDisplayMode = perspectiveManager.getLivePerspectiveDefinition().getContextDisplayMode();
  if (perspectiveContextDisplayMode == SHOW
      && getDefinition().getContextDisplayMode() == SHOW
      && part.getDefinition().getContextDisplayMode() == SHOW) {
    ContextActivity contextActivity = null;
    if (contextId != null) {
      contextActivity = activityManager.getActivity(ContextActivity.class,
                             new DefaultPlaceRequest(contextId));
    } else if (part.getDefinition().getContextDefinition() != null) {
      contextActivity = activityManager.getActivity(ContextActivity.class,
                             part.getDefinition().getContextDefinition().getPlace());
    } else if (part.getContextId() != null) {
      contextActivity = activityManager.getActivity(ContextActivity.class,
                             new DefaultPlaceRequest(part.getContextId()));
    }
    if (contextActivity != null) {
      contextActivities.put(part.getDefinition(),
                 contextActivity);
    }
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

void setupCSSLocators(WorkbenchPartPresenter.View view,
               FlowPanel panel) {
  if (view.getPresenter() != null || view.getPresenter().getTitle() != null) {
    panel.getElement().addClassName(CSSLocatorsUtils.buildLocator("qe-list-bar-content",
                                   view.getPresenter().getTitle()));
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly

void setupContextMenu() {
  contextMenu.clear();
  final WorkbenchPartPresenter.View part = (WorkbenchPartPresenter.View) currentPart.getK2().getWidget(0);
  if (part.getPresenter().getMenus() != null && part.getPresenter().getMenus().getItems().size() > 0) {
    for (final MenuItem menuItem : part.getPresenter().getMenus().getItems()) {
      final Widget result = makeItem(menuItem,
                      true);
      if (result != null) {
        contextMenu.add(result);
      }
    }
  }
  contextMenu.setVisible(contextMenu.getWidgetCount() > 0);
}

代码示例来源:origin: kiegroup/appformer

@SuppressWarnings("unused")
private void onChangeTitleWidgetEvent(@Observes ChangeTitleWidgetEvent event) {
  final PlaceRequest place = event.getPlaceRequest();
  final IsWidget titleDecoration = event.getTitleDecoration();
  final String title = event.getTitle();
  for (Map.Entry<PanelDefinition, WorkbenchPanelPresenter> e : mapPanelDefinitionToPresenter.entrySet()) {
    final PanelDefinition panel = e.getKey();
    final WorkbenchPanelPresenter presenter = e.getValue();
    for (PartDefinition part : ensureIterable(panel.getParts())) {
      if (place.equals(part.getPlace())) {
        mapPartDefinitionToPresenter.get(part).setTitle(title);
        presenter.changeTitle(part,
                   title,
                   titleDecoration);
        break;
      }
    }
  }
}

代码示例来源:origin: kiegroup/appformer

public void addPart(final WorkbenchPartPresenter.View view) {
  final PartDefinition part = view.getPresenter().getDefinition();
  partView.put(part,
         view);
  buildWidgets(part,
         view.getPresenter().getTitle(),
         view.getPresenter().getTitleDecoration());
  if (partTitles.size() == 1) {
    selectPart(part);
  }
}

代码示例来源:origin: kiegroup/appformer

@Override
public void addPart(final WorkbenchPartPresenter.View view) {
  if (!tabIndex.containsKey(view)) {
    final TabPanelEntry tab = tabPanel.addItem(view.getPresenter().getTitle(),
                          view.asWidget());
    resizeIfNeeded(view.asWidget());
    tabIndex.put(view,
           tab);
    tabInvertedIndex.put(tab,
               view);
    partTabIndex.put(view.getPresenter().getDefinition(),
             tab);
    dndManager.makeDraggable(view,
                 tab.getTabWidget());
    addCloseToTab(tab);
    parts.add(view.getPresenter());
    tabIndex.put(view,
           tab);
    updateDisplayedTabs();
  }
}

代码示例来源:origin: org.uberfire/uberfire-workbench-client

never()).setWrappedWidget(uiPart.getWidget());
verify(partPresenter,
    never()).setContextId("rootContextId");

代码示例来源:origin: kiegroup/appformer

void setupCSSLocators(WorkbenchPartPresenter.View view,
               FlowPanel panel) {
  if (view.getPresenter() != null || view.getPresenter().getTitle() != null) {
    panel.getElement().addClassName(CSSLocatorsUtils.buildLocator("qe-list-bar-content",
                                   view.getPresenter().getTitle()));
  }
}

代码示例来源:origin: kiegroup/appformer

void setupContextMenu() {
  contextMenu.clear();
  final WorkbenchPartPresenter.View part = (WorkbenchPartPresenter.View) currentPart.getK2().getWidget(0);
  if (part.getPresenter().getMenus() != null && part.getPresenter().getMenus().getItems().size() > 0) {
    for (final MenuItem menuItem : part.getPresenter().getMenus().getItems()) {
      final Widget result = makeItem(menuItem,
                      true);
      if (result != null) {
        contextMenu.add(result);
      }
    }
  }
  contextMenu.setVisible(contextMenu.getWidgetCount() > 0);
}

代码示例来源:origin: kiegroup/appformer

private TabPanelEntry getTab(int i) {
  return checkNotNull("part entry in map",
            partTabIndex.get(parts.get(i).getDefinition()));
}

代码示例来源:origin: kiegroup/appformer

@Override
public void addPart(final WorkbenchPartPresenter.View view) {
  final PartDefinition partDefinition = view.getPresenter().getDefinition();
  if (parts.containsKey(partDefinition) == false) {
    final MultiScreenView screen = multiScreenViews.get();
    screen.setContent(view);
    screen.setTitle(view.getPresenter().getTitle());
    if (view.getPresenter().getTitleDecoration() != null) {
      screen.setTitleWidget(view.getPresenter().getTitleDecoration());
    }
    if (parts.isEmpty() && partDefinition.getParentPanel().getPosition() == null) {
      screen.disableClose();
    }
    screen.setCloseHandler(() -> panelManager.closePart(partDefinition));
    Optional.ofNullable(view.getPresenter().getMenus())
        .ifPresent(menus -> menus.getItems().stream().map(menuBuilder)
            .forEachOrdered(e -> e.ifPresent(element -> screen.addMenus(element)))
    );
    content.appendChild(screen.getElement());
    parts.put(partDefinition,
         screen);
  }
  selectPart(partDefinition);
}

代码示例来源:origin: kiegroup/appformer

@Override
public WorkbenchPartPresenter newWorkbenchPart(final Menus menus,
                        final String title,
                        final IsWidget titleDecoration,
                        final PartDefinition definition,
                        final Class<? extends WorkbenchPartPresenter> partType) {
  final WorkbenchPartPresenter part = iocManager.lookupBean(partType).getInstance();
  part.setTitle(title);
  part.setMenus(menus);
  part.setTitleDecoration(titleDecoration);
  part.setDefinition(definition);
  return part;
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com