• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WindowEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.extjs.gxt.ui.client.event.WindowEvent的典型用法代码示例。如果您正苦于以下问题:Java WindowEvent类的具体用法?Java WindowEvent怎么用?Java WindowEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WindowEvent类属于com.extjs.gxt.ui.client.event包,在下文中一共展示了WindowEvent类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteSelected

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
protected void deleteSelected() {
	final List<BaseModel> items = grid.getSelectionModel().getSelectedItems();
	final MessageBox confirm = MessageBox.confirm("Delete", "Delete " + items.size() + " default values", new Listener<WindowEvent>() {

		public void handleEvent(WindowEvent be) {
			 Button btn = be.buttonClicked;  
			 if (btn.getItemId().equals(Dialog.YES)) {
				 // Remove items...
				 for (BaseModel item : items) {
					 store.remove(item);
					 removeModel(item);
				 }
			 }
			 
		}			
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:18,代码来源:MDRTransformDefaultValueTable.java


示例2: initialize

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
@Override
protected void initialize()
{
    this.loginWidget = new LoginWidget();

    this.loginWidget.addListener(Events.Hide, new Listener<WindowEvent>()
        {

            public void handleEvent(WindowEvent be)
            {
                Dispatcher.forwardEvent(GeofenceEvents.INIT_GEOFENCE_MAIN_UI);
                loginWidget.reset();
            }
        });

    initWidget();
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:18,代码来源:LoginController.java


示例3: setWindowProperties

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
@Override
public void setWindowProperties()
{
    setHeading("Search for Registered Member");
    super.setSize(420, 490);

    super.addWindowListener(new WindowListener()
        {

            @Override
            public void windowShow(WindowEvent we)
            {
                searchText = "";
                loader.load(0, 25);
            }

        });
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:19,代码来源:SearchPagUserWidget.java


示例4: initializeWindow

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
/**
 * Initialize window.
 */
private void initializeWindow() {
    initSize();
    setResizable(false);

    addWindowListener(new WindowListener() {

        @Override
        public void windowHide(WindowEvent we) {
            reset();
        }

    });

    setLayout(new FitLayout());
    setModal(true);
    setPlain(true);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:21,代码来源:GeofenceFormWidget.java


示例5: initWindow

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
/**
 * Inits the window.
 */
private void initWindow() {
    setModal(true);
    setResizable(false);
    setLayout(new FlowLayout());
    setPlain(true);
    setMaximizable(false);

    addWindowListener(new WindowListener() {

        @Override
        public void windowHide(WindowEvent we) {
            cancel();
        }

    });

    setWindowProperties();
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:22,代码来源:GeofenceSearchWidget.java


示例6: info

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
public static MessageBox info(String title, String msg, Listener<WindowEvent> callback) {
  MessageBox box = new MessageBox();
  box.setTitle(title);
  box.setMessage(msg);
  box.setButtons(OK);
  box.setIcon(INFO);
  box.show();
  if (callback != null) {
  	box.addCallback(callback);
  }
  return box;
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:13,代码来源:MyMessageBox.java


示例7: storeConfig

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
protected void storeConfig(final boolean close) {
	ModelServiceFactory.get().storeTransformConfig(CMDBSession.get().getToken(), 
			CMDBSession.get().getDefaultCMDB_MDR(), 
			mdr, 
			mdrConfig, 
			transformConfig, 
			new CMDBAsyncCallback<Boolean>() {

				@Override
				public void onSuccess(Boolean arg0) {
					modelChanged = false;
					MessageBox.info("Saved", "Transform Configuration Saved", new Listener<WindowEvent>() {

						public void handleEvent(WindowEvent be) {
							if (close) {
								if (getParent() instanceof Window) {
									doClose = true;
									((Window)getParent()).close();
								}
							}
						}
						
					});	
					
				}
		
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:29,代码来源:MDRConfigureWindow.java


示例8: showError

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
public static void showError(String title, Throwable t, Listener<WindowEvent> callback) {
	/*
	MessageBox box = MessageBox.prompt(title, t.getMessage(), true);
	box.getTextArea().setValue(t.toString());
	*/
	if (t instanceof CMDBRPCException) {
		showRPCException((CMDBRPCException)t, callback);
	} else {
		MessageBox.alert(title, t.getMessage() + "<br>" + t.toString(), callback);
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:12,代码来源:ExceptionErrorDialog.java


示例9: doRemove

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private void doRemove() {
	final MessageBox commitInfo = MessageBox.wait("Progress",  
             "Delete your data, please wait...", "Deleting..."); 
	store.commitChanges();
	
	ChangeServiceFactory.get().delete(CMDBSession.get().getToken(), mdr, mdrConfig, mdrConfigHistory, store.getModels(), new AsyncCallback<StoreResult>() {

		public void onFailure(Throwable arg0) {
			commitInfo.close();
			ExceptionErrorDialog.showError("Can't Delete", arg0);			
		}

		public void onSuccess(StoreResult result) {
			commitInfo.close();
			if (result.isRejected()) {
				MessageBox.alert("Delete Failed", result.getRejectCause(), null);
				return;
			}
			
			MyMessageBox.info("Deleted", HTMLGenerator.toHTML(result), new Listener<WindowEvent>() {

				public void handleEvent(WindowEvent be) {
					// Will reload and verify.
					resultSet = null;
					loader.load();
				}
				
			});
		}
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:32,代码来源:CompareGridWidget.java


示例10: getOkSelection

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private SelectionListener getOkSelection() {
	return(new SelectionListener<ComponentEvent>() {
		@Override
		public void componentSelected(ComponentEvent ce) {
			
			List<ValueModel> removeValues = store.findModels("delete", true);
			for (ValueModel removeValue : removeValues) {
				newValues.remove(removeValue);
				if (config.isEditTemplate()) {
					if (values.getValues().size() == 1) {
						MessageBox.alert("Not allowed", "On template one attribute must exists!", new Listener<WindowEvent>() {

							public void handleEvent(WindowEvent be) {
								cancel = true;
								fireEvent(Events.Select, new ComponentEvent(MultiValueGrid.this));
								return;
							}
							
						});
						return;
											
					}
				}
				values.removeValue(removeValue);
			}
			store.commitChanges();
			// Add all new values.
			for (ValueModel vModel : newValues) {
				values.addValue(vModel);
			}
			
			fireEvent(Events.Select, new ComponentEvent(MultiValueGrid.this));
		}
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:36,代码来源:MultiValueGrid.java


示例11: doValidate

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private void doValidate() {
	if (fileName.isValid()) {
		final MessageBox saveInfo = MessageBox.wait("Progress",  
	             "Validate your data, please wait...", "Validate..."); 
		
		final ContentFile file = new ContentFile();
		if (modelRoot != null) {
			file.setPath(modelRoot + "/" + fileName.getValue());
		} else {
			file.setPath(fileName.getValue());
		}
		
		ContentServiceFactory.get().stat(file, new AsyncCallback<ContentData>() {

			public void onFailure(Throwable caught) {
				
			}

			public void onSuccess(final ContentData result) {
				saveInfo.hide();
				boolean isDir = result.get("isDirectory", false);
				if (isDir) {
					MessageBox.alert("Problem", file.getPath() + " is a directory!", null).show();
					return;
				}
				boolean exists = result.get("exists", false);
				if (exists) {
					
					MessageBox.confirm("File exists", "File " + result.getPath() + " exists!<br>Overwrite?", new Listener<WindowEvent>() {  
						public void handleEvent(WindowEvent ce) {
							Dialog dialog = (Dialog) ce.component;  
							Button btn = dialog.getButtonPressed();  
							if (btn.getItemId().equals(Dialog.YES)) {
								doSave(result);
							}
						}
					}); 
					return;
				}
				
				// Save it.
				doSave(result);
			}
		});
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:47,代码来源:CMDBModelSaveWindow.java


示例12: doDelete

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
protected void doDelete(final boolean verify) {
	String message = "Verify deleting your data, please wait...";
	String prgText = "Verifing..."; 
	if (!verify) {
		message = "Deleting your data, please wait...";
		prgText = "Deleting..."; 
	}
	final MessageBox saveInfo = MessageBox.wait("Progress",  
             message, prgText); 
	SaveDeleteRequest req = new SaveDeleteRequest();
	req.setTemplates(templateStore.getModels());
	req.setReferences(referenceStore.getModels());
	req.setVerify(verify);
	ModelServiceFactory.get().delete(CMDBSession.get().getToken(), mdr, req, new AsyncCallback<SaveResponse>() {

		public void onFailure(Throwable caught) {
			saveInfo.close();
			ExceptionErrorDialog.showError("Can't delete!", caught);
		}

		public void onSuccess(SaveResponse result) {
			saveInfo.close();
			if (verify) {
				MessageBox.confirm("Confirm", "Delete " + 
						result.getTemplateCIs() + 
						" templates and " + 
						result.getInstanceCIs() + 
						" instances!" + 
						"<br>Are you sure?", new Listener<WindowEvent>() {
					
					public void handleEvent(WindowEvent ce) {
						Dialog dialog = (Dialog) ce.component;  
						Button btn = dialog.getButtonPressed();  
						if (btn.getItemId().equals(Dialog.YES)) {
							doDelete(false);
						}
					}
				}); 
			} else {
				
				if (result.isFailed()) {
					MessageBox.alert("Can't delete", result.getFailedCause(), null).show();
				} else {
					MessageBox.alert("Model Deleted", "CI's delete." + 
						"<br>" + result.getTemplateCIs() + " Templates deleted" + 
						"<br>" + result.getInstanceCIs() + " Instances deleted", null).show();
				}
			}
		}
	});
	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:53,代码来源:CMDBModelClearWindow.java


示例13: getRemoveSelection

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private SelectionListener getRemoveSelection() {
	SelectionListener selection = new SelectionListener<ComponentEvent>() {  
		public void componentSelected(ComponentEvent ce) {

			final MessageBox box = MessageBox.confirm("Delete template " + modelBase.getAlias(), "Are you sure ?", new Listener<WindowEvent>() {  
				public void handleEvent(WindowEvent be) {
					Dialog dialog = (Dialog) be.component;  
					Button btn = dialog.getButtonPressed();  
					if (!btn.getItemId().equals(Dialog.YES)) {
						return;
					}
					List<CIModel> base = new ArrayList<CIModel>();
					List<CIModel> local = new ArrayList<CIModel>();
					base.add(modelBase);
					// Call create.
					final MessageBox deleteInfo = MessageBox.wait("Progress",  
							"Delete, please wait...", "Deleting...");  

					ModelServiceFactory.get().store(mdr, CMDBSession.get().getToken(), local, base, new AsyncCallback<StoreResult>() {

						public void onFailure(Throwable caught) {
							deleteInfo.close();
							ExceptionErrorDialog.showError("Can't Delete", caught);
							//loader.load();
						}

						public void onSuccess(StoreResult result) {
							deleteInfo.close();

							if (result.isRejected()) {
								MessageBox.alert("Delete Failed", result.getRejectCause(), null);
								return;
							}
							
							center.removeAll();
							center.setHeading("");
							// TODO: Check errors on storeResult...
							TreeItem parent = currentTreeItem.getParentItem();
							if (parent == null) {
								browser.reload();
								return;
							}
							if (parent.getModel() instanceof CIModel) {
								browser.reloadChildren((CIModel)parent.getModel());
							}
						}

					});
				}  
			});  
		}
	};
	return(selection);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:55,代码来源:CIModelInternalBrowser.java


示例14: getSaveSelection

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private SelectionListener getSaveSelection() {
	return(new SelectionListener<ComponentEvent>() {
		@Override
		public void componentSelected(ComponentEvent ce) {
			if (!attributeGrid.commitSave()) {
				return;
			}
			
			if (!defaultValueGrid.commit()) {
				return;
			}
			
			final MessageBox saveInfo = MessageBox.wait("Progress",  
		             "Saving your data, please wait...", "Saving..."); 
			
			
			List<CIModel> local = new ArrayList<CIModel>();
			List<CIModel> base = new ArrayList<CIModel>();

			local.add(modelLocal);
			base.add(modelBase);
			
			ModelServiceFactory.get().store(mdr, CMDBSession.get().getToken(), local, base, new AsyncCallback<StoreResult>() {

				public void onFailure(Throwable caught) {
					// Error.
					saveInfo.close();
					ExceptionErrorDialog.showError("Can't Save", caught);
				}

				public void onSuccess(StoreResult result) {
					saveInfo.close();
					// saved
					if (result.isRejected()) {
						MessageBox.alert("Save Failed", result.getRejectCause(), new Listener<WindowEvent>() {
							public void handleEvent(WindowEvent be) {
								reloadModel();
							}
						});
						return;
					} else {
						reloadModel();
					}
				}
			});
		}
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:49,代码来源:CIModelInternalBrowser.java


示例15: getSaveSelection

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private SelectionListener getSaveSelection() {
	return(new SelectionListener<ComponentEvent>() {
	

		@Override
		public void componentSelected(ComponentEvent ce) {
			if (!editCI.commit()) {
				return;
			}
			
			final MessageBox saveInfo = MessageBox.wait("Progress",  
		             "Saving your data, please wait...", "Saving..."); 
			
			
			List<CIModel> local = new ArrayList<CIModel>();
			List<CIModel> base = new ArrayList<CIModel>();

			local.add(localData.getCIModels().get(0));
			base.add(baseData.getCIModels().get(0));
			
			ModelServiceFactory.get().store(mdr, CMDBSession.get().getToken(), local, base, new AsyncCallback<StoreResult>() {

				public void onFailure(Throwable caught) {
					// Error.
					saveInfo.close();
					ExceptionErrorDialog.showError("Can't Save", caught);
				}

				public void onSuccess(StoreResult result) {
					saveInfo.close();
					// saved
					if (result.isRejected()) {
						MessageBox.alert("Save Failed", result.getRejectCause(), new Listener<WindowEvent>() {
							public void handleEvent(WindowEvent be) {
							
							}
						});
						return;
					} else {
						DeferredCommand.addCommand(new Command() {

							public void execute() {
								refTree.reload(localData.getCIModels().get(0));
							}
							
						});
					}
				}
			});
		}
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:53,代码来源:CIInstanceEditableReferenceTreeV2.java


示例16: getSaveSelection

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
private SelectionListener getSaveSelection() {
	return(new SelectionListener<ComponentEvent>() {
	

		@Override
		public void componentSelected(ComponentEvent ce) {
			if (!editCI.commit()) {
				return;
			}
			
			final MessageBox saveInfo = MessageBox.wait("Progress",  
		             "Saving your data, please wait...", "Saving..."); 
			
			
			List<CIModel> local = new ArrayList<CIModel>();
			List<CIModel> base = new ArrayList<CIModel>();

			local.add(modelLocal);
			base.add(modelBase);
			
			ModelServiceFactory.get().store(mdr, CMDBSession.get().getToken(), local, base, new AsyncCallback<StoreResult>() {

				public void onFailure(Throwable caught) {
					// Error.
					saveInfo.close();
					ExceptionErrorDialog.showError("Can't Save", caught);
				}

				public void onSuccess(StoreResult result) {
					saveInfo.close();
					// saved
					if (result.isRejected()) {
						MessageBox.alert("Save Failed", result.getRejectCause(), new Listener<WindowEvent>() {
							public void handleEvent(WindowEvent be) {
							
							}
						});
						return;
					} else {
					}
				}

			});
		}
	});
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:47,代码来源:CIInstanceEditableReferenceTree.java


示例17: showRPCException

import com.extjs.gxt.ui.client.event.WindowEvent; //导入依赖的package包/类
public static void showRPCException(CMDBRPCException e, Listener<WindowEvent> callback) {
	Dialog d = new Dialog();
	d.setLayout(new FitLayout());
	
	//FormPanel form = new FormPanel();
	LayoutContainer area = new LayoutContainer();  
	area.setStyleAttribute("padding", "0 10px 5px 10px");  
	//area.setWidth(450);  
	FormLayout layout = new FormLayout();  
	layout.setLabelAlign(LabelAlign.TOP);
	layout.setDefaultWidth(380);
	area.setLayout(layout);
	
	d.setHeading(e.getHeader());
	
	LabelField field = new LabelField("<b>Received an error from server.<b>");
	
	TextArea stackTrace = new TextArea();
	stackTrace.setFieldLabel("Stacktrace");
	stackTrace.setValue(e.getRemoteStackTrace());
	stackTrace.setReadOnly(true);
	stackTrace.setHeight(200);
	
	TextArea info = new TextArea();
	info.setFieldLabel("Error");
	info.setHeight(60);
	info.setReadOnly(true);
	info.setValue(e.getMessage());
		
	area.add(field);
	area.add(info);
	area.add(stackTrace);
	d.add(area);
	d.setSize(430, 430);
	d.layout();
	d.setHideOnButtonClick(true);
	d.show();
	
	
	/*
	MessageBox box = MessageBox.prompt(title, t.getMessage(), true);
	box.getTextArea().setValue(t.toString());
	*/
	//MessageBox.alert(e.getHeader(), e.getMessage() + "<br>" + e.getRemoteStackTrace(), callback);  
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:46,代码来源:ExceptionErrorDialog.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Scene类代码示例发布时间:2022-05-22
下一篇:
Java RecognitionException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap