本文整理了Java中org.eclipse.che.ide.api.action.ActionEvent
类的一些代码示例,展示了ActionEvent
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionEvent
类的具体详情如下:
包路径:org.eclipse.che.ide.api.action.ActionEvent
类名称:ActionEvent
[英]Container for the information necessary to execute or update an BaseAction.
[中]用于执行或更新BaseAction所需信息的容器。
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
/** {@inheritDoc} */
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void handleEvent(Event evt) {
ActionEvent event = new ActionEvent(presentation, actionManager);
action.actionPerformed(event);
}
},
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void actionPerformed(ActionEvent e) {
if (e.getParameters() == null) {
Log.error(getClass(), "Can't show welcome page without parameters");
return;
}
greetingPart.showGreeting(e.getParameters());
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void onActionSelected(Action action) {
ActionEvent e = new ActionEvent(presentationFactory.getPresentation(action), actionManager);
action.update(e);
if (e.getPresentation().isEnabled() && e.getPresentation().isVisible()) {
view.hide();
action.actionPerformed(e);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
/** @return true when at list one item from list of menu items has selected state. */
private boolean hasCheckedItems() {
return list.stream()
.filter(action -> action instanceof ToggleAction)
.map(action -> (ToggleAction) action)
.anyMatch(
action ->
action.isSelected(
new ActionEvent(presentationFactory.getPresentation(action), actionManager)));
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
/** {@inheritDoc} */
@Override
public void actionPerformed(ActionEvent e) {
Map<String, String> params = e.getParameters();
if (params != null && params.containsKey(PATH)) {
String pathToReveal = params.get(PATH);
Path path = valueOf(pathToReveal);
checkState(!path.isEmpty());
ensureProjectExplorerActive();
eventBus.fireEvent(new RevealResourceEvent(path));
} else {
final Resource[] resources = appContext.getResources();
checkState(resources != null && resources.length == 1);
ensureProjectExplorerActive();
eventBus.fireEvent(new RevealResourceEvent(resources[0]));
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
/** Mouse Click handler. */
@Override
public void onClick(ClickEvent event) {
if (!enabled) {
return;
}
// todo handle popup group
ActionEvent e = new ActionEvent(presentation, actionManager);
if (action instanceof ActionGroup
&& !(action instanceof CustomComponentAction)
&& ((ActionGroup) action).isPopup()) {
} else {
action.actionPerformed(e);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
private void expandActionGroup(
List<Action> newVisibleActions, ActionManager actionManager, ActionGroup mainActionGroup) {
final Action[] children = mainActionGroup.getChildren(null);
for (final Action action : children) {
final Presentation presentation = presentationFactory.getPresentation(action);
final ActionEvent e = new ActionEvent(presentation, actionManager);
action.update(e);
if (presentation.isVisible()) { // add only visible items
newVisibleActions.add(action);
}
if (action2barItem.containsKey(action)) {
action2barItem.get(action).update();
}
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
private void expandActionGroup(
List<Action> newVisibleActions, ActionManager actionManager, ActionGroup mainActionGroup) {
final Action[] children = mainActionGroup.getChildren(null);
for (final Action action : children) {
final Presentation presentation = presentationFactory.getPresentation(action);
final ActionEvent e = new ActionEvent(presentation, actionManager);
action.update(e);
if (presentation.isVisible()) { // add only visible items
newVisibleActions.add(action);
}
if (action2barItem.containsKey(action)) {
action2barItem.get(action).update();
}
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
protected EditorTab getEditorTab(ActionEvent e) {
Object o = e.getPresentation().getClientProperty(CURRENT_TAB_PROP);
if (o instanceof EditorTab) {
return (EditorTab) o;
}
throw new IllegalStateException("Tab doesn't provided");
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void performAction(String actionId, Map<String, String> parameters) {
final Action action;
if (actionId != null && (action = getAction(actionId)) != null) {
final Presentation presentation = presentationFactory.getPresentation(action);
final ActionEvent actionEvent = new ActionEvent(presentation, this, parameters);
action.update(actionEvent);
if (presentation.isEnabled() && presentation.isVisible()) {
action.actionPerformed(actionEvent);
}
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
protected EditorPartStack getEditorPane(ActionEvent e) {
Object o = e.getPresentation().getClientProperty(CURRENT_PANE_PROP);
if (o instanceof EditorPartStack) {
return (EditorPartStack) o;
}
throw new IllegalStateException("Editor pane doesn't provided");
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@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));
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void update(ActionEvent e) {
if (!(activePart instanceof ProjectExplorerPresenter)) {
e.getPresentation().setEnabledAndVisible(false);
return;
}
e.getPresentation().setEnabledAndVisible(true);
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(true);
}
}
内容来源于网络,如有侵权,请联系作者删除!