当前位置: 首页>>代码示例>>Java>>正文


Java PartPresenter类代码示例

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


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

示例1: PartStackPresenter

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Inject
public PartStackPresenter(
    final EventBus eventBus,
    final PartMenu partMenu,
    PartStackEventHandler partStackEventHandler,
    TabItemFactory tabItemFactory,
    PartsComparator partsComparator,
    @Assisted final PartStackView view,
    @Assisted @NotNull WorkBenchPartController workBenchPartController) {
  this.view = view;
  this.view.setDelegate(this);

  this.eventBus = eventBus;
  this.partMenu = partMenu;
  this.partStackHandler = partStackEventHandler;
  this.workBenchPartController = workBenchPartController;
  this.tabItemFactory = tabItemFactory;
  this.partsComparator = partsComparator;

  this.parts = new HashMap<>();
  this.constraints = new LinkedHashMap<>();

  this.propertyListener =
      new PropertyListener() {
        @Override
        public void propertyChanged(PartPresenter source, int propId) {
          if (PartPresenter.TITLE_PROPERTY == propId) {
            updatePartTab(source);
          } else if (EditorPartPresenter.PROP_DIRTY == propId) {
            eventBus.fireEvent(new EditorDirtyStateChangedEvent((EditorPartPresenter) source));
          }
        }
      };

  if (workBenchPartController != null) {
    this.workBenchPartController.setSize(DEFAULT_PART_SIZE);
  }

  currentSize = DEFAULT_PART_SIZE;
}
 
开发者ID:eclipse,项目名称:che,代码行数:41,代码来源:PartStackPresenter.java

示例2: selectTab

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void selectTab(@NotNull PartPresenter partPresenter) {
  IsWidget view = partPresenter.getView();
  int viewIndex = partStackContent.getWidgetIndex(view);

  boolean isWidgetExist = viewIndex != -1;

  if (!isWidgetExist) {
    partPresenter.go(partViewContainer);

    viewIndex = partStackContent.getWidgetIndex(view);
  }

  partStackContent.showWidget(viewIndex);

  setActiveTab(partPresenter);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:PartStackViewImpl.java

示例3: addPart

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void addPart(
    @NotNull PartPresenter part, @NotNull PartStackType type, @Nullable Constraints constraint) {
  PartStack destPartStack = partStacks.get(type);

  List<String> rules = part.getRules();
  if (rules.isEmpty() || rules.contains(perspectiveId)) {
    destPartStack.addPart(part, constraint);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:AbstractPerspective.java

示例4: getPartStackState

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
private JsonObject getPartStackState(
    PartStack partStack, WorkBenchPartController partController) {
  JsonObject state = Json.createObject();
  state.put("SIZE", partController.getSize());
  state.put("STATE", partStack.getPartStackState().name());

  if (partStack.getParts().isEmpty()) {
    state.put("HIDDEN", true);
  } else {
    if (partStack.getActivePart() != null) {
      state.put("ACTIVE_PART", partStack.getActivePart().getClass().getName());
    }

    state.put("HIDDEN", partController.isHidden());

    JsonArray parts = Json.createArray();
    state.put("PARTS", parts);
    int i = 0;
    for (PartPresenter entry : partStack.getParts()) {
      JsonObject presenterState = Json.createObject();
      presenterState.put("CLASS", entry.getClass().getName());
      parts.set(i++, presenterState);
    }
  }
  return state;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:AbstractPerspective.java

示例5: update

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void update(@NotNull PartPresenter part) {
  if (badgeWidget != null) {
    badgeWidget.getElement().removeFromParent();
    badgeWidget = null;
  }

  int unreadMessages = part.getUnreadNotificationsCount();
  if (unreadMessages == 0) {
    return;
  }

  badgeWidget = getBadge(unreadMessages);
  if (badgeWidget != null) {
    iconPanel.getParent().getElement().appendChild(badgeWidget.asWidget().getElement());
    updateBadge();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:PartButtonWidget.java

示例6: getPartByPath

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Nullable
public PartPresenter getPartByPath(Path path) {
  for (TabItem tab : parts.keySet()) {
    EditorTab editorTab = (EditorTab) tab;
    Path currentPath = editorTab.getFile().getLocation();

    if (currentPath.equals(path)) {
      return parts.get(tab);
    }
  }
  return null;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:EditorPartStackPresenter.java

示例7: onItemClicked

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void onItemClicked(@NotNull EditorPaneMenuItem<Action> item) {
  editorPaneMenu.hide();

  final Action action = item.getData();
  final Presentation presentation = presentationFactory.getPresentation(action);
  presentation.putClientProperty(CURRENT_PANE_PROP, EditorPartStackPresenter.this);

  final PartPresenter activePart = getActivePart();
  final TabItem tab = getTabByPart(activePart);

  if (tab != null) {
    final VirtualFile virtualFile = ((EditorTab) tab).getFile();
    // pass into action file property and editor tab
    presentation.putClientProperty(CURRENT_TAB_PROP, tab);
    presentation.putClientProperty(CURRENT_FILE_PROP, virtualFile);
  }
  action.actionPerformed(new ActionEvent(presentation, actionManager, null));
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:EditorPartStackPresenter.java

示例8: addTab

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void addTab(@NotNull TabItem tabItem, @NotNull PartPresenter partPresenter) {
  /** Show editor area if it is empty and hidden */
  if (contents.isEmpty()) {
    getElement().getParentElement().getStyle().setDisplay(BLOCK);
  }

  /** Add editor tab to tab panel */
  tabsPanel.insert(tabItem.getView(), tabsPanel.getWidgetIndex(plusPanel));

  /** Process added editor tab */
  tabs.put(partPresenter, tabItem);
  contents.add(partPresenter);
  partPresenter.go(partViewContainer);
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:EditorPartStackView.java

示例9: selectTab

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void selectTab(@NotNull PartPresenter partPresenter) {
  IsWidget view = partPresenter.getView();

  // set/remove attribute 'active' for Selenium tests
  for (int i = 0; i < contentPanel.getWidgetCount(); i++) {
    contentPanel.getWidget(i).getElement().removeAttribute("active");
  }
  view.asWidget().getElement().setAttribute("active", "");

  int viewIndex = contentPanel.getWidgetIndex(view);
  if (viewIndex < 0) {
    partPresenter.go(partViewContainer);
    viewIndex = contentPanel.getWidgetIndex(view);
  }

  contentPanel.showWidget(viewIndex);
  setActiveTab(partPresenter);

  if (partPresenter instanceof TextEditor) {
    ((TextEditor) partPresenter).activate();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:25,代码来源:EditorPartStackView.java

示例10: setActiveTab

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
/**
 * Switches to specified tab.
 *
 * @param part tab part
 */
private void setActiveTab(@NotNull PartPresenter part) {
  for (TabItem tab : tabs.values()) {
    tab.unSelect();
    tab.getView().asWidget().getElement().removeAttribute("active");
  }

  activeTab = tabs.get(part);
  activeTab.select();

  activeTab.getView().asWidget().getElement().setAttribute("active", "");

  delegate.onRequestFocus();

  // reset timer and schedule it again
  ensureActiveTabVisibleTimer.cancel();
  ensureActiveTabVisibleTimer.schedule(200);
}
 
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:EditorPartStackView.java

示例11: actionPerformed

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  ProjectExplorerPresenter projectExplorerPresenter = projectExplorerPresenterProvider.get();
  PartPresenter activePart = workspaceAgent.getActivePart();
  if (activePart != null && activePart instanceof ProjectExplorerPresenter) {
    workspaceAgent.hidePart(projectExplorerPresenter);

    EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
    if (activeEditor != null) {
      workspaceAgent.setActivePart(activeEditor);
    }
    return;
  }

  workspaceAgent.openPart(projectExplorerPresenter, NAVIGATION);
  workspaceAgent.setActivePart(projectExplorerPresenter);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:ProjectExplorerDisplayingModeAction.java

示例12: actionPerformed

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  FindResultPresenter findResultPresenter = findResultPresenterProvider.get();
  PartPresenter activePart = workspaceAgent.getActivePart();
  if (activePart != null && activePart instanceof FindResultPresenter) {
    workspaceAgent.hidePart(findResultPresenter);

    EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
    if (activeEditor != null) {
      workspaceAgent.setActivePart(activeEditor);
    }
    return;
  }

  workspaceAgent.openPart(findResultPresenter, INFORMATION);
  workspaceAgent.setActivePart(findResultPresenter);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:FindResultDisplayingModeAction.java

示例13: actionPerformed

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  NotificationManager notificationManager = notificationManagerProvider.get();
  PartPresenter activePart = workspaceAgent.getActivePart();
  if (activePart != null && activePart instanceof NotificationManager) {
    workspaceAgent.hidePart(notificationManager);

    EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
    if (activeEditor != null) {
      workspaceAgent.setActivePart(activeEditor);
    }
    return;
  }

  workspaceAgent.openPart(notificationManager, INFORMATION);
  workspaceAgent.setActivePart(notificationManager);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:EventLogsDisplayingModeAction.java

示例14: actionPerformed

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  CommandsExplorerPresenter commandsExplorerPresenter = commandsExplorerPresenterProvider.get();
  PartPresenter activePart = workspaceAgent.getActivePart();
  if (activePart != null && activePart instanceof CommandsExplorerPresenter) {
    workspaceAgent.hidePart(commandsExplorerPresenter);

    EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
    if (activeEditor != null) {
      workspaceAgent.setActivePart(activeEditor);
    }
    return;
  }

  workspaceAgent.openPart(commandsExplorerPresenter, NAVIGATION);
  workspaceAgent.setActivePart(commandsExplorerPresenter);
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:CommandsExplorerDisplayingModeAction.java

示例15: openEditor

import org.eclipse.che.ide.api.parts.PartPresenter; //导入依赖的package包/类
@Override
public void openEditor(@NotNull VirtualFile file, @NotNull OpenEditorCallback callback) {
  Path path = file.getLocation();
  EditorPartStack activeEditorPartStack = editorMultiPartStack.getActivePartStack();
  if (activeEditorPartStack != null) {
    PartPresenter openedPart = activeEditorPartStack.getPartByPath(path);
    if (openedPart != null) {
      editorMultiPartStack.setActivePart(openedPart);
      callback.onEditorActivated((EditorPartPresenter) openedPart);
      return;
    }

    if (isFileOpening(path, activeEditorPartStack)) {
      return;
    }
  } else {
    activeEditorPartStack = editorMultiPartStack.createRootPartStack();
  }

  doOpen(file, activeEditorPartStack, callback);
}
 
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:EditorAgentImpl.java


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