本文整理汇总了Java中com.google.gwt.user.client.Window.confirm方法的典型用法代码示例。如果您正苦于以下问题:Java Window.confirm方法的具体用法?Java Window.confirm怎么用?Java Window.confirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Window
的用法示例。
在下文中一共展示了Window.confirm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteConfirmation
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean deleteConfirmation(List<Project> projects) {
String message;
GallerySettings gallerySettings = GalleryClient.getInstance().getGallerySettings();
if (projects.size() == 1) {
if (projects.get(0).isPublished()) {
message = MESSAGES.confirmDeleteSinglePublishedProject(projects.get(0).getProjectName());
} else {
message = MESSAGES.confirmDeleteSingleProject(projects.get(0).getProjectName());
}
} else {
StringBuilder sb = new StringBuilder();
String separator = "";
for (Project project : projects) {
sb.append(separator).append(project.getProjectName());
separator = ", ";
}
String projectNames = sb.toString();
if(!gallerySettings.galleryEnabled()){
message = MESSAGES.confirmDeleteManyProjects(projectNames);
} else {
message = MESSAGES.confirmDeleteManyProjectsWithGalleryOn(projectNames);
}
}
return Window.confirm(message);
}
示例2: deleteConfirmation
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean deleteConfirmation(List<Project> projects) {
String message;
GallerySettings gallerySettings = GalleryClient.getInstance().getGallerySettings();
if (projects.size() == 1) {
if (projects.get(0).isPublished())
message = MESSAGES.confirmDeleteSinglePublishedProject(projects.get(0).getProjectName());
else
message = MESSAGES.confirmDeleteSingleProject(projects.get(0).getProjectName());
} else {
StringBuilder sb = new StringBuilder();
String separator = "";
for (Project project : projects) {
sb.append(separator).append(project.getProjectName());
separator = ", ";
}
String projectNames = sb.toString();
if(!gallerySettings.galleryEnabled()){
message = MESSAGES.confirmDeleteManyProjects(projectNames);
} else {
message = MESSAGES.confirmDeleteManyProjectsWithGalleryOn(projectNames);
}
}
return Window.confirm(message);
}
示例3: execute
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@Override
public void execute() {
Ode ode = Ode.getInstance();
if (ode.screensLocked()) {
return; // Don't permit this if we are locked out (saving files)
}
YoungAndroidSourceNode sourceNode = ode.getCurrentYoungAndroidSourceNode();
if (sourceNode != null && !sourceNode.isScreen1()) {
// DeleteFileCommand handles the whole operation, including displaying the confirmation
// message dialog, closing the form editor and the blocks editor,
// deleting the files in the server's storage, and deleting the
// corresponding client-side nodes (which will ultimately trigger the
// screen deletion in the DesignToolbar).
final String deleteConfirmationMessage = MESSAGES.reallyDeleteForm(
sourceNode.getFormName());
ChainableCommand cmd = new DeleteFileCommand() {
@Override
protected boolean deleteConfirmation() {
return Window.confirm(deleteConfirmationMessage);
}
};
cmd.startExecuteChain(Tracking.PROJECT_ACTION_REMOVEFORM_YA, sourceNode);
}
}
示例4: removeCurrentlySelectedRepository
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Removes a template repository.
*/
private void removeCurrentlySelectedRepository() {
boolean ok = Window.confirm("Are you sure you want to remove this repository? " +
"Click cancel to abort.");
if (ok) {
dynamicTemplateUrls.remove(templateHostUrl);
templatesMap.remove(templateHostUrl);
templatesMenu.removeItem(lastSelectedIndex);
templatesMenu.setSelectedIndex(1);
templatesMenu.setItemSelected(1, true);
removeButton.setVisible(false);
retrieveSelectedTemplates(templatesMenu.getValue(1));
// Update the user settings
UserSettings settings = Ode.getUserSettings();
settings.getSettings(SettingsConstants.USER_GENERAL_SETTINGS).
changePropertyValue(SettingsConstants.USER_TEMPLATE_URLS,
TemplateUploadWizard.getStoredTemplateUrls());
settings.saveSettings(null);
}
}
示例5: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final DatasetLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getId();
boolean y = Window.confirm("Ready to delete " + node.getText() + "?");
if (y) {
DatasetServiceAsync svc = GWT.create(DatasetService.class);
svc.delete(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Delete", command);
return item;
}
示例6: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final ProgramLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getId();
boolean y = Window.confirm("Are you ready to delete " + node.getText() + "?");
if (y) {
ProgramServiceAsync svc = GWT.create(ProgramService.class);
svc.delete(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("delete", command);
return item;
}
示例7: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final JobLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getJobId();
boolean y = Window.confirm("Are you sure you want to join the example task?");
if (y) {
JobServiceAsync srv = GWT.create(JobService.class);
srv.setExampleJobs(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Join example task", command);
return item;
}
示例8: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final ProgramLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getId();
boolean y = Window.confirm("Are you ready to deprecate " + node.getModule().getName() + "?");
if (y) {
ProgramServiceAsync svc = GWT.create(ProgramService.class);
svc.deprecate(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("deprecate", command);
return item;
}
示例9: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final JobLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getJobId();
boolean y = Window.confirm("Are you sure you want to delete?");
if (y) {
JobServiceAsync srv = GWT.create(JobService.class);
srv.deleteJob(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Delete", command);
return item;
}
示例10: create
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static MenuItem create(final DatasetLeaf node) {
Command command = new MenuItemCommand(node) {
@Override
public void execute() {
String id = node.getModule().getId();
boolean y = Window.confirm("Ready to deprecate " + node.getModule().getName() + "?");
if (y) {
DatasetServiceAsync svc = GWT.create(DatasetService.class);
svc.deprecate(id, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Void result) {
node.delete();
}
});
}
this.component.getContextMenu().hide();
}
};
MenuItem item = new MenuItem("Deprecate", command);
return item;
}
示例11: confirm
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
public static void confirm(boolean useDefault, String message, Command callback) {
if (useDefault) {
if (Window.confirm(message))
callback.execute();
} else {
confirm(message, callback);
}
}
示例12: execute
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@Override
public void execute() {
Tracking.trackEvent(Tracking.PROJECT_EVENT,
Tracking.PROJECT_ACTION_DOWNLOAD_ALL_PROJECTS_SOURCE_YA);
// Is there a way to disable the Download All button until this completes?
if (Window.confirm(MESSAGES.downloadAllAlert())) {
Downloader.getInstance().download(ServerLayout.DOWNLOAD_SERVLET_BASE +
ServerLayout.DOWNLOAD_ALL_PROJECTS_SOURCE);
}
}
示例13: confirmOverwrite
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean confirmOverwrite(FolderNode folderNode, String newFile, String existingFile) {
return Window.confirm(MESSAGES.confirmOverwrite(newFile, existingFile));
}
示例14: MockComponent
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Creates a new instance of the component.
*
* @param editor editor of source file the component belongs to
*/
MockComponent(SimpleEditor editor, String type, Image iconImage) {
this.editor = editor;
this.type = type;
this.iconImage = iconImage;
COMPONENT_DATABASE = SimpleComponentDatabase.getInstance(editor.getProjectId());
componentDefinition = COMPONENT_DATABASE.getComponentDefinition(type);
sourceStructureExplorerItem = new SourceStructureExplorerItem() {
@Override
public void onSelected() {
// are we showing the blocks editor? if so, toggle the component drawer
if (Ode.getInstance().getCurrentFileEditor() instanceof YaBlocksEditor) {
YaBlocksEditor blocksEditor =
(YaBlocksEditor) Ode.getInstance().getCurrentFileEditor();
OdeLog.log("Showing item " + getName());
blocksEditor.showComponentBlocks(getName());
} else {
select();
}
}
@Override
public void onStateChange(boolean open) {
// The user has expanded or collapsed the branch in the components tree corresponding to
// this component. Remember that by setting the expanded field so that when we re-build
// the tree, we will keep the branch in the same state.
expanded = open;
}
@Override
public boolean canRename() {
return !isForm();
}
@Override
public void rename() {
if (!isForm()) {
new RenameDialog(getName()).center();
}
}
@Override
public boolean canDelete() {
return !isForm();
}
@Override
public void delete() {
if (!isForm()) {
if (Window.confirm(MESSAGES.reallyDeleteComponent())) {
MockComponent.this.delete();
}
}
}
};
expanded = true;
// Create a default property set for the component
properties = new EditableProperties(true);
// Add the mock component itself as a property change listener so that it can update its
// visual aspects according to changes of its properties
properties.addPropertyChangeListener(this);
// Allow dragging this component in a drag-and-drop action if this is not the root form
if (!isForm()) {
dragSourceSupport = new DragSourceSupport(this);
addMouseListener(dragSourceSupport);
}
}
示例15: deleteConfirmation
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Shows a confirmation dialog.
*
* @return {@code true} if the delete file command should be executed or
* {@code false} if it should be canceled
*/
protected boolean deleteConfirmation() {
return Window.confirm(MESSAGES.reallyDeleteFile());
}