本文整理汇总了Java中com.google.gwt.user.client.Command类的典型用法代码示例。如果您正苦于以下问题:Java Command类的具体用法?Java Command怎么用?Java Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Command类属于com.google.gwt.user.client包,在下文中一共展示了Command类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createClickCommand
import com.google.gwt.user.client.Command; //导入依赖的package包/类
private Command createClickCommand(final IBookmarkable accModule) {
return new Command() {
@Override
public void execute() {
if (mode == Mode.BOOKMARKING) {
bookmarkModule(accModule);
resetMode();
}
if (mode == Mode.CLEARING) {
if (isModuleBookmarked(accModule, currItemIndex)) {
bookmarkModule(accModule, false);
resetMode();
}
} else if (mode == Mode.EDITING) {
if (isModuleBookmarked(accModule, currItemIndex)) {
editBookmark(accModule);
resetMode();
}
}
}
};
}
示例2: showContextualMenu
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Show the context menu of the mouse position.(Position from mouse down event)
*
* @param event mouse down event.
*/
public void showContextualMenu(MouseDownEvent event){
final int X = event.getRelativeX(widgetPanel.getElement());
final int Y = event.getRelativeY(widgetPanel.getElement());
getMousePoint().setLeft(X);
getMousePoint().setTop(Y);
final int offsetX = event.getClientX();
final int offsetY = event.getClientY();
mouseOffsetPoint.setLeft(offsetX);
mouseOffsetPoint.setTop(offsetY);
cmenu.hide();
cmenu = new ContextMenu();
Command command = new Command() {
@Override
public void execute() {
cmenu.hide();
}
};
}
示例3: create
import com.google.gwt.user.client.Command; //导入依赖的package包/类
public static MenuItem create(final ProgramLeaf node, final ProgramTree tree) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
UpdateProgramPanel panel = new UpdateProgramPanel(tree,node);
panel.show(node.getModule());
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Update", command);
return item;
}
示例4: createDeleteItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create DeleteItem
* @param com
* @return delete item
*/
public static MenuItem createDeleteItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
BaseWidget widget = (BaseWidget) this.component;
DiagramController controller = widget.getController();
controller.deleteWidget(widget);
widget.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Delete", command);
return item;
}
示例5: createPremeterItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create PremeterItem
* @param com
* @return PremeterItem
*/
public static MenuItem createPremeterItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
ProgramWidget widget = (ProgramWidget) this.component;
widget.getParameterPanel();
widget.setETLPanel();
widget.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Configure parameters", command);
return item;
}
示例6: createDownloadData
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create DownloadDataItem
* @param com
* @return DownloadDataItem
*/
public static MenuItem createDownloadData(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
DatasetWidget widget = (DatasetWidget) this.component;
widget.getContextMenu().hide();
OutNodeShape shape = widget.getOutNodeShapes().get(0);
String filename = shape.getAbsolutePath() + "/" + shape.getFileId();
String url = GWT.getModuleBaseURL().split("EMLStudio")[0]
+ "EMLStudioMonitor/filedownload?filename=" + filename;
Window.open(url, "_blank", "status=0,toolbar=0,menubar=0,location=0");
}
};
MenuItem item = new MenuItem("Download", command);
return item;
}
示例7: createStderrItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create StderrItem
* @param com
* @return StderrItem
*/
public static MenuItem createStderrItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
ProgramWidget widget = (ProgramWidget) this.component;
MonitorController controller = (MonitorController) widget
.getController();
String oozJobId = widget.getAction().getJobId();
String actionid = widget.getId();
controller.getStdErr(oozJobId, actionid);
widget.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Show Stderr", command);
return item;
}
示例8: createStdoutItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create StdoutItem
* @param com
* @return StdoutItem
*/
public static MenuItem createStdoutItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
ProgramWidget widget = (ProgramWidget) this.component;
MonitorController controller = (MonitorController) widget
.getController();
String oozJobId = widget.getAction().getJobId();
String actionid = widget.getId();
controller.getStdOut(oozJobId, actionid);
widget.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Show Stdout", command);
return item;
}
示例9: createShowResultItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create result preview popup menuitem
*
* @param com
* @return
*/
public static MenuItem createShowResultItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
NodeShape nodeShape = (NodeShape) this.component;
//If the shape node is output node shape
if(nodeShape instanceof OutNodeShape) {
OutNodeShape outShape = (OutNodeShape) nodeShape;
String fileId = outShape.getFileId();
String path = outShape.getAbsolutePath();
DBController.showPreviewPopup(path,fileId);
}
nodeShape.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Results preview", command);
return item;
}
示例10: createVisuallizeItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
/**
* Create data visualization popup menuitem
*
* @param com
* @return
*/
public static MenuItem createVisuallizeItem(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
NodeShape nodeShape = (NodeShape) this.component;
// If the node shape is output node shape
if(nodeShape instanceof OutNodeShape) {
OutNodeShape outShape = (OutNodeShape) nodeShape;
String fileId = outShape.getFileId();
String path = outShape.getAbsolutePath();
String fPath = path +"/"+fileId;
DBController.showDataVisualPopup(fPath,fileId);
}
nodeShape.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Visualization", command);
return item;
}
示例11: SuggestionMenuItem
import com.google.gwt.user.client.Command; //导入依赖的package包/类
private SuggestionMenuItem(final Suggestion suggestion) {
super(suggestion.getDisplayString() == null
? suggestion.getChip().getLabel() + " <span class='item-command'>" + suggestion.getChip().getTranslatedCommand() + "</span>"
: SafeHtmlUtils.htmlEscape(suggestion.getDisplayString()) + (suggestion.getHint() == null ? "" : " " + suggestion.getHint()),
true,
new Command() {
@Override
public void execute() {
hideSuggestions();
setStatus(ARIA.suggestionSelected(suggestion.toAriaString(FilterBox.this)));
applySuggestion(suggestion);
iLastValue = getValue();
setAriaLabel(toAriaString());
fireSelectionEvent(suggestion);
ValueChangeEvent.fire(FilterBox.this, getValue());
}
});
setStyleName("item");
getElement().setAttribute("whiteSpace", "nowrap");
iSuggestion = suggestion;
}
示例12: getEventsRequest
import com.google.gwt.user.client.Command; //导入依赖的package包/类
private EventFilterRpcRequest getEventsRequest() {
EventFilterRpcRequest request = new EventFilterRpcRequest();
request.setSessionId(iSession.getAcademicSessionId());
request.setCommand(FilterRpcRequest.Command.ENUMERATE);
iSelectedTimes = iTimes.getValue();
if (iSelectedTimes.getStart() != null) {
int startHour = Math.max(0, (iSelectedTimes.getStart() - 6) / 12);
request.setOption("after", TimeUtils.slot2time(12 * startHour));
}
if (iSelectedTimes.getEnd() != null) {
int endHour = Math.min(24, (17 + iSelectedTimes.getEnd()) / 12);
request.setOption("before", TimeUtils.slot2time(12 * endHour));
}
iSelectedDates = iDates.getSelectedDays();
for (Integer date: iSelectedDates) {
request.addOption("dates", date.toString());
}
return request;
}
示例13: execute
import com.google.gwt.user.client.Command; //导入依赖的package包/类
@Override
protected void execute(final ProjectNode node) {
Ode.getInstance().getEditorManager().generateYailForBlocksEditors(
new Command() {
@Override
public void execute() {
executeNextCommand(node);
}
},
new Command() {
@Override
public void execute() {
executionFailedOrCanceled();
}
});
}
示例14: execute
import com.google.gwt.user.client.Command; //导入依赖的package包/类
@Override
public void execute() {
Ode.getInstance().getEditorManager().saveDirtyEditors(new Command() {
@Override
public void execute() {
List<Project> selectedProjects =
ProjectListBox.getProjectListBox().getProjectList().getSelectedProjects();
if (selectedProjects.size() > 0) {
// Show one confirmation window for selected projects.
if (deleteConfirmation(selectedProjects)) {
for (Project project : selectedProjects) {
deleteProject(project);
}
}
} else {
// The user can select a project to resolve the
// error.
ErrorReporter.reportInfo(MESSAGES.noProjectSelectedForDelete());
}
}
});
}
示例15: execute
import com.google.gwt.user.client.Command; //导入依赖的package包/类
@Override
public void execute() {
ProjectRootNode projectRootNode = Ode.getInstance().getCurrentYoungAndroidProjectRootNode();
if (projectRootNode != null) {
String target = YoungAndroidProjectNode.YOUNG_ANDROID_TARGET_ANDROID;
ChainableCommand cmd = new SaveAllEditorsCommand(
new GenerateYailCommand(
new BuildCommand(target,
new ShowProgressBarCommand(target,
new WaitForBuildResultCommand(target,
new ShowBarcodeCommand(target)), "BarcodeAction"))));
// updateBuildButton(true);
cmd.startExecuteChain(Tracking.PROJECT_ACTION_BUILD_BARCODE_YA, projectRootNode,
new Command() {
@Override
public void execute() {
// updateBuildButton(false);
}
});
}
}