本文整理汇总了Java中com.extjs.gxt.ui.client.event.WindowEvent类的典型用法代码示例。如果您正苦于以下问题:Java WindowEvent类的具体用法?Java WindowEvent怎么用?Java WindowEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WindowEvent类属于com.extjs.gxt.ui.client.event包,在下文中一共展示了WindowEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
}
});
}
示例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();
}
示例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);
}
});
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
}
}
});
}
});
}
示例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);
}
}
示例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();
}
});
}
});
}
示例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));
}
});
}
示例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);
}
});
}
}
示例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();
}
}
}
});
}
示例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);
}
示例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();
}
}
});
}
});
}
示例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));
}
});
}
}
});
}
});
}