本文整理汇总了Java中com.google.gwt.user.client.Window.alert方法的典型用法代码示例。如果您正苦于以下问题:Java Window.alert方法的具体用法?Java Window.alert怎么用?Java Window.alert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.Window
的用法示例。
在下文中一共展示了Window.alert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUncaughtException
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@UncaughtExceptionHandler
private void onUncaughtException(Throwable caught) {
try {
if (caught instanceof JSONException
&& caught.getMessage().contains("unexpected character at line 1 column 1 of the JSON data")) {
// Not sure how best to deal with this when using MessageBus
logger.info("JsonParseException usually as a result of failed redirect to login from message bus");
Window.Location.assign("/");
} else {
throw caught;
}
} catch (Throwable t) {
Window.alert(t.getMessage());
GWT.log("An unexpected error has occurred", t);
}
}
示例2: checkNewProjectName
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Determines whether the given project name is valid, displaying an alert
* if it is not. In order to be valid, the project name must satisfy
* {@link #isValidIdentifier(String)} and not be a duplicate of an existing
* project name for the same user.
*
* @param projectName the project name to validate
* @return {@code true} if the project name is valid, {@code false} otherwise
*/
public static boolean checkNewProjectName(String projectName) {
// Check the format of the project name
if (!isValidIdentifier(projectName)) {
Window.alert(MESSAGES.malformedProjectNameError());
return false;
}
// Check that project does not already exist
if (Ode.getInstance().getProjectManager().getProject(projectName) != null) {
Window.alert(MESSAGES.duplicateProjectNameError(projectName));
return false;
}
return true;
}
示例3: upgradeSourceProperties
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Upgrades the given sourceProperties if necessary.
*
* @param sourceProperties the properties from the source file
* @return true if the sourceProperties was upgraded, false otherwise
*/
public static boolean upgradeSourceProperties(Map<String, JSONValue> sourceProperties) {
StringBuilder upgradeDetails = new StringBuilder();
try {
int srcYaVersion = getSrcYaVersion(sourceProperties);
if (needToUpgrade(srcYaVersion)) {
Map<String, JSONValue> formProperties =
sourceProperties.get("Properties").asObject().getProperties();
upgradeComponent(srcYaVersion, formProperties, upgradeDetails);
// The sourceProperties were upgraded. Update the version number.
setSrcYaVersion(sourceProperties);
if (upgradeDetails.length() > 0) {
Window.alert(MESSAGES.projectWasUpgraded(upgradeDetails.toString()));
}
return true;
}
} catch (LoadException e) {
// This shouldn't happen. If it does it's our fault, not the user's fault.
Window.alert(MESSAGES.unexpectedProblem(e.getMessage()));
OdeLog.xlog(e);
}
return false;
}
示例4: submitUploadDataset2DB
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Submit the uploaded dataSet information to the database.
*
* @param fileUploader
* @param grid
* @return If submit is success
* @throws CommandParseException
*/
public boolean submitUploadDataset2DB(final Presenter presenter,final UploadFileModule fileUploader
,Dataset dataset, DescribeGrid grid)
throws CommandParseException {
String name = grid.getText("Name");
if (name == null || "".equals(name)) {
Window.alert("Name could not be empty!");
return false;
}
String category = grid.getText("Category");
if(category == null || "".equals(category) || category.equals("Choose Category")){
Window.alert("Category could not be empty!");
return false;
}
datasetBinder.sync(grid, dataset);
fileUploader.setUpLoadDataset(dataset);
datasetSrv.upload(grid.asDataset(dataset), fileUploader.getNewFileUUID(),
new AsyncCallback<Dataset>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(Dataset result) {
fileUploader.setUpLoadDataset(result);
}
});
return true;
}
示例5: okAction
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@Override
protected boolean okAction() {
int selected = assetsList.getSelectedIndex();
if (selected == -1) {
Window.alert(MESSAGES.noAssetSelected());
return false;
}
property.setValue(choices.getValueAtIndex(selected));
return true;
}
示例6: showPreviewPopup
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Show file preview popup panel.
*
* @param path File hdfs path
* @param fileId File id
*/
public static void showPreviewPopup(final String path,String fileId){
//Download dataset from corresponding dataset module
if(path.contains("null"))
{
Window.alert("No results have been produced yet!");
return;
}
final PreviewPopupPanel previewPopup = new PreviewPopupPanel(path);
datasetSrv.loadFile(path, new AsyncCallback<Dataset>() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Loading data failed!");
logger.info(caught.getMessage());
}
@Override
public void onSuccess(Dataset result) {
if (result == null)
return;
previewPopup.setDataset(result);
previewPopup.getSavebtn().setVisible(true);
previewPopup.getRefreshBtn().setVisible(true);
previewPopup.getUploadSubmitButton().setVisible(true);
previewPopup.getDesc().setText("File information - " + result.getName());
}
});
// Set the current data's resource path
previewPopup.setSourceUrl( path );
previewPopup.center();
}
示例7: showDataVisualPopup
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Data Visualization
*
* @param path file path
* @param fileId fileId
*/
public static void showDataVisualPopup(final String path,String fileId){
//Data module visualization
if(path.contains("null"))
{
Window.alert("The results have not been produced yet!");
return;
}
datasetSrv.loadFile(path, new AsyncCallback<Dataset>() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Loading data failed!");
logger.info(caught.getMessage());
}
@Override
public void onSuccess(Dataset result) {
if (result == null)
return;
if(result.getContenttype() == null)
{
Window.alert("Data type is not defined ,please select the data type first!");
DataTypeSelectPanel dataSelectPanel = new DataTypeSelectPanel(path,result);
dataSelectPanel.getDescLabel().setText("Data Type Selection - " + result.getName());
dataSelectPanel.center();
}
else if(result.getContenttype().equals(DatasetType.GENERAL.getDesc()))
Window.alert("Visualization only support json、tsv、csv data type!");
else
{
DataVisualPopPanel chartPopPanel = new DataVisualPopPanel(path ,result);
chartPopPanel.getDescLabel().setText("Data Visualization - " + result.getName());
chartPopPanel.center();
}
}
});
}
示例8: validateText
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private void validateText() {
String text = textEdit.getText();
try {
validate(text);
property.setValue(text);
} catch (InvalidTextException e) {
String error = e.getMessage();
if (error == null || error.isEmpty()) {
error = MESSAGES.malformedInputError();
}
Window.alert(error);
updateValue(); // Restore previous property value.
}
}
示例9: onKeyPress
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@Override
public void onKeyPress(Widget sender, char key, int mods) {
if (KeyboardListener.KEY_ENTER == key)
{
if(!DataTools.isPosInteger(bins.getText()))
Window.alert("Bin size should be a positive integer, please fill again!");
else
drawBarCharts(selectedColumn);
}
}
示例10: validate
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean validate(String newName) {
// Check that it meets the formatting requirements.
if (!TextValidators.isValidComponentIdentifier(newName)) {
Window.alert(MESSAGES.malformedComponentNameError());
return false;
}
// Check that it's unique.
final List<String> names = editor.getComponentNames();
if (names.contains(newName)) {
Window.alert(MESSAGES.duplicateComponentNameError());
return false;
}
// Check that it is a variable name used in the Yail code
if (YAIL_NAMES.contains(newName)) {
Window.alert(MESSAGES.badComponentNameError());
return false;
}
//Check that it is not a Component type name, as this is bad for generics
SimpleComponentDatabase COMPONENT_DATABASE = SimpleComponentDatabase.getInstance();
if (COMPONENT_DATABASE.isComponent(newName)) {
Window.alert(MESSAGES.sameAsComponentTypeNameError());
return false;
}
return true;
}
示例11: createProgramConf
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Create Program Conf
* @return program conf
*/
@Override
protected ProgramConf createProgramConf() {
Commander cmd = null;
try {
cmd = CommandParser.parse(program.getCommandline());
} catch (CommandParseException e) {
Window.alert( e.getMessage() );
}
CommonProgramConf conf = new CommonProgramConf(cmd, program.isStandalone());
return conf;
}
示例12: validate
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
private boolean validate(String newFormName) {
// Check that it meets the formatting requirements.
if (!TextValidators.isValidIdentifier(newFormName)) {
Window.alert(MESSAGES.malformedFormNameError());
return false;
}
// Check that it's unique.
if (otherFormNames.contains(newFormName)) {
Window.alert(MESSAGES.duplicateFormNameError());
return false;
}
return true;
}
示例13: checkIfReadyToPublishOrUpdateApp
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* check if it is ready to publish or update GalleryApp
* 1.The minimum length of Desc must be at least MIN_DESC_LENGTH
* 2.User must upload an image first, in order to publish GaleryApp
* @param app
* @return
*/
private boolean checkIfReadyToPublishOrUpdateApp(GalleryApp app){
if(app.getDescription().length() < MIN_DESC_LENGTH){
Window.alert(MESSAGES.galleryNotEnoughDescriptionMessage());
return false;
}
if(!imageUploaded && editStatus==NEWAPP){
/*we only need to check the image on the publish status*/
Window.alert(MESSAGES.galleryNoScreenShotMessage());
return false;
}
return true;
}
示例14: execute
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
@Override
public void execute() {
DesignToolbar.DesignProject currentProject = Ode.getInstance().getDesignToolbar().getCurrentProject();
if (currentProject == null) {
Window.alert(MESSAGES.companionUpdateMustHaveProject());
return;
}
DesignToolbar.Screen screen = currentProject.screens.get(currentProject.currentScreen);
screen.blocksEditor.updateCompanion();
}
示例15: submitUploadProgram2DB
import com.google.gwt.user.client.Window; //导入方法依赖的package包/类
/**
* Submit the uploaded program information to the database.
*
* @param presenter
* @param fileUploader
* @param program
* @param grid
* @return If submit is success
* @throws CommandParseException
*/
public boolean submitUploadProgram2DB(final Presenter presenter, final UploadFileModule fileUploader,
Program program, final DescribeGrid grid)
throws CommandParseException {
String name = grid.getText("Name");
if (name == null || "".equals(name)) {
Window.alert("Name could not be empty!");
return false;
}
String category = grid.getText("Category");
if(category == null || "".equals(category) || category.equals("Choose Category")){
Window.alert("Category could not be empty!");
return false;
}
String cmdline = grid.getText("CommandLine");
if (cmdline == null || "".equals(cmdline)) {
Window.alert("CommandLine could not be empty!");
return false;
} else {
String programable = grid.getText("Programable");
if( !Constants.studioUIMsg.yes().equals( programable ) )
CommandParser.parse(cmdline);
}
logger.info("grid"+grid.ProgramToString());
programBinder.sync(grid, program);
fileUploader.setUpLoadProgram(program);
logger.info("programm"+grid.asProgram(program).toString());
programSrv.upload(grid.asProgram(program), fileUploader.getNewFileUUID(),
new AsyncCallback<Program>() {
@Override
public void onFailure(Throwable caught) {
logger.info(caught.getMessage());
}
@Override
public void onSuccess(Program result) {
fileUploader.setUpLoadProgram(result);
logger.info("Program insert to DB:"+result.getCategory());
}
});
return true;
}