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


Java Window.confirm方法代码示例

本文整理汇总了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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:26,代码来源:ProjectToolbar.java

示例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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:25,代码来源:TopToolbar.java

示例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);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:25,代码来源:DesignToolbar.java

示例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);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:TemplateUploadWizard.java

示例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;
	}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:32,代码来源:DatasetDeleteMenu.java

示例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;
	}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:32,代码来源:ProgramDeleteMenu.java

示例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;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:29,代码来源:JobAddExampleMenu.java

示例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;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:31,代码来源:ProgramDeprecateMenu.java

示例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;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:29,代码来源:JobDeleteMenu.java

示例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;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:30,代码来源:DatasetDeprecateMenu.java

示例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);
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:9,代码来源:UniTimeConfirmationDialog.java

示例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);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:13,代码来源:TopToolbar.java

示例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));
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:4,代码来源:FileUploadWizard.java

示例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);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:76,代码来源:MockComponent.java

示例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());
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:10,代码来源:DeleteFileCommand.java


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