本文整理汇总了Java中com.google.gwt.user.client.Window类的典型用法代码示例。如果您正苦于以下问题:Java Window类的具体用法?Java Window怎么用?Java Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Window类属于com.google.gwt.user.client包,在下文中一共展示了Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDepartment
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public void setDepartment(Integer department) {
this.department = department;
clearFields();
departmentService.getDepartment(department, new AsyncCallback<DepartmentInfo>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(DepartmentInfo result) {
initFields(result);
}
});
}
示例2: setEmployee
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public void setEmployee(Integer employee) {
this.employee = employee;
clearFields();
employeeService.getEmployee(employee, new AsyncCallback<EmployeeInfo>() {
@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}
@Override
public void onSuccess(EmployeeInfo result) {
initFields(result);
}
});
}
示例3: 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);
}
示例4: 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);
}
}
示例5: ComponentRemoveWidget
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public ComponentRemoveWidget(SimpleComponentDescriptor simpleComponentDescriptor) {
if (imageResource == null) {
Images images = Ode.getImageBundle();
imageResource = images.deleteComponent();
}
this.scd = simpleComponentDescriptor;
AbstractImagePrototype.create(imageResource).applyTo(this);
addClickListener(new ClickListener() {
@Override
public void onClick(Widget widget) {
if (Window.confirm(MESSAGES.reallyRemoveComponent())) {
long projectId = ode.getCurrentYoungAndroidProjectId();
YaProjectEditor projectEditor = (YaProjectEditor) ode.getEditorManager().getOpenProjectEditor(projectId);
SimpleComponentDatabase componentDatabase = SimpleComponentDatabase.getInstance();
componentDatabase.addComponentDatabaseListener(projectEditor);
componentDatabase.removeComponent(scd.getName());
}
}
});
}
示例6: continueDrawingCurve
import com.google.gwt.user.client.Window; //导入依赖的package包/类
protected void continueDrawingCurve(int clientX, int clientY) {
int newX = clientX - canv.getAbsoluteLeft() + Window.getScrollLeft();
int newY = clientY - canv.getAbsoluteTop() + Window.getScrollTop();
if (getDistance(x, y, newX, newY) > dist_buffer) {
ctx.beginPath();
ctx.setLineWidth(5);
ctx.setStrokeStyle(color);
ctx.moveTo(x, y);
ctx.lineTo(newX, newY);
ctx.moveTo(newX, newY);
ctx.closePath();
ctx.stroke();
points.add(new Point(x, y, color));
(points.get(points.size() - 1)).draw(this);
x = newX;
y = newY;
if (lastUpdateTime + updateTime < new Date().getTime()) {
endDrawingCurve(clientX, clientY);
}
}
}
示例7: initWidget
import com.google.gwt.user.client.Window; //导入依赖的package包/类
@PostConstruct
protected void initWidget() {
templateFetchable = new TenantTemplateFetchable(() -> getTenantId());
calendar = new Calendar.Builder<SpotId, ShiftData, ShiftDrawable>(container, tenantId, CONSTANTS)
.fetchingDataFrom(templateFetchable)
.fetchingGroupsFrom(new SpotNameFetchable(() -> getTenantId()))
.displayWeekAs(DateDisplay.WEEKS_FROM_EPOCH)
.withBeanManager(beanManager)
.creatingDataInstancesWith((c, name, start, end) -> {
Shift newShift = new Shift(tenantId,
name.getSpot(),
new TimeSlot(tenantId,
start,
end));
newShift.setId(templateFetchable.getFreshId());
c
.addShift(new ShiftData(new SpotData(newShift)));
})
.asTwoDayView((v, d, i) -> new ShiftDrawable(v, d, i));
calendar.setHardStartDateBound(LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC));
Window.addResizeHandler((e) -> calendar.setViewSize(e.getWidth() - container.getAbsoluteLeft(),
e.getHeight() - container.getAbsoluteTop() - saveButton.getOffsetHeight()));
}
示例8: logout
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public void logout() {
accountSrv.logout(new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Window.Location.reload();
}
@Override
public void onSuccess(Void result) {
AppController.redirect("index.html?url=" + AppController.getUrl());
}
});
}
示例9: onMouseUp
import com.google.gwt.user.client.Window; //导入依赖的package包/类
/**
* Trigger action when mouse up event fired
*
* @param event
*/
protected void onMouseUp(MouseUpEvent event) {
// Test if Right Click
if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
logger.info( "Handle NativeEvent.BUTTON_RIGHT begin >");
event.stopPropagation();
event.preventDefault();
logger.info("Handle NativeEvent.BUTTON_RIGHT end <");
return;
}
if ( !lockDrawConnection && inDragBuildConnection ) {
logger.info( "draw connection lock: " + lockDrawConnection );
NodeShape shape = (NodeShape) getShapeUnderMouse();
if (shape != null && shape instanceof InNodeShape) {
Connection c = connfactory.buildConnection(this, startShape, shape);
if (c == null) {
Window.alert("Connection can't be build");
} else {
c.draw();
connDrawSet.add(c);
((NodeShape) startShape).onConnectionEnd(c);
shape.onConnectionEnd(c);
}
}else {
((NodeShape) startShape).onConnectionCancel();
}
deleteConnection(buildConnection);
inDragBuildConnection = false;
buildConnection = null;
}
}
示例10: createDownloadData
import com.google.gwt.user.client.Window; //导入依赖的package包/类
/**
* Create DownloadDataItem
* @param com
* @return DownloadDataItem
*/
public static MenuItem createDownloadData(HasRightMouseUpMenu com) {
Command command = new MenuItemCommand(com) {
@Override
public void execute() {
DatasetWidget widget = (DatasetWidget) this.component;
widget.getContextMenu().hide();
OutNodeShape shape = widget.getOutNodeShapes().get(0);
String filename = shape.getAbsolutePath() + "/" + shape.getFileId();
String url = GWT.getModuleBaseURL().split("EMLStudio")[0]
+ "EMLStudioMonitor/filedownload?filename=" + filename;
Window.open(url, "_blank", "status=0,toolbar=0,menubar=0,location=0");
}
};
MenuItem item = new MenuItem("Download", command);
return item;
}
示例11: showRequestDetail
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public void showRequestDetail(Long id) {
iAssignmentTable.clearTable(1);
LoadingWidget.getInstance().show(MESSAGES.waitLoadTeachingRequestDetail());
ToolBox.setMaxHeight(iScroll.getElement().getStyle(), Math.round(0.9 * Window.getClientHeight()) + "px");
RPC.execute(new TeachingRequestDetailRequest(id), new AsyncCallback<TeachingRequestInfo>() {
@Override
public void onFailure(Throwable caught) {
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadTeachingRequestDetail(caught.getMessage()), caught);
ToolBox.checkAccess(caught);
}
@Override
public void onSuccess(TeachingRequestInfo result) {
LoadingWidget.getInstance().hide();
populate(result, null, null);
GwtHint.hideHint();
center();
RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
}
});
}
示例12: showInstructorDetail
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public void showInstructorDetail(Long id) {
iAssignmentTable.clearTable(1);
LoadingWidget.getInstance().show(MESSAGES.waitLoadTeachingRequestDetail());
ToolBox.setMaxHeight(iScroll.getElement().getStyle(), Math.round(0.9 * Window.getClientHeight()) + "px");
RPC.execute(new TeachingAssignmentsDetailRequest(id), new AsyncCallback<InstructorInfo>() {
@Override
public void onFailure(Throwable caught) {
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadTeachingRequestDetail(caught.getMessage()), caught);
ToolBox.checkAccess(caught);
}
@Override
public void onSuccess(InstructorInfo result) {
LoadingWidget.getInstance().hide();
populate(null, null, result);
GwtHint.hideHint();
center();
RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
}
});
}
示例13: 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;
}
示例14: getInstance
import com.google.gwt.user.client.Window; //导入依赖的package包/类
public static AriaStatus getInstance() {
if (sStatus == null) {
RootPanel statusPanel = RootPanel.get("UniTimeGWT:AriaStatus");
if (statusPanel != null && "1".equals(Window.Location.getParameter("aria"))) {
sStatus = new AriaStatus(statusPanel.getElement(), false);
sStatus.setStyleName("unitime-VisibleAriaStatus");
} else {
sStatus = new AriaStatus(false);
RootPanel.get().add(sStatus);
}
RootPanel.get().addDomHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
if (event.getNativeEvent().getKeyCode() == 191 && (event.isControlKeyDown() || event.isAltKeyDown())) {
sStatus.setHTML(sStatus.getHTML());
}
}
}, KeyUpEvent.getType());
}
return sStatus;
}
示例15: refreshTable
import com.google.gwt.user.client.Window; //导入依赖的package包/类
@Override
protected void refreshTable() {
calendar.setViewSize(Window.getClientWidth() - container.getAbsoluteLeft(),
Window.getClientHeight() - container.getAbsoluteTop());
if (tenantId == null) {
return;
}
if (!isDateSet) {
RosterRestServiceBuilder.getCurrentSpotRosterView(tenantId, new FailureShownRestCallback<SpotRosterView>() {
@Override
public void onSuccess(SpotRosterView spotRosterView) {
isDateSet = true;
calendar.setDate(spotRosterView.getTimeSlotList().stream().min((a, b) -> a.getStartDateTime()
.compareTo(b.getStartDateTime())).get().getStartDateTime());
}
});
}
calendar.forceUpdate();
}