Java Code Examples for com.google.gwt.user.client.ui.RootPanel.add()

The following are Jave code examples for showing how to use add() of the com.google.gwt.user.client.ui.RootPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: gwt-rxjs-jsinterop   File: OnPageTest.java   Source Code and License Vote up 6 votes
@Override
public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get("main");
    final Button button = new Button("Click me");
    rootPanel.add(button);
    
    ObservableEx.fromKeyboardEvent(button.getElement(), "keydown")
            .map(event -> event.ctrlKey)
            .take(5)
            .subscribe(v -> log("ctrlKey " + v));
    
    ObservableEx.fromMouseEvent(button.getElement(), "click")
            .map(event -> event.clientX)
            .take(5)
            .subscribe(v -> log("clientX " + v));        
}
 
Example 2
Project: unitimes   File: SolverAllocatedMemory.java   Source Code and License Vote up 6 votes
public void insert(final RootPanel panel) {
	String id = panel.getElement().getInnerText();
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
	RPC.execute(new SolverAllocatedMemoryRpcRequest(id), new AsyncCallback<SolverAllocatedMemoryRpcResponse>() {
		@Override
		public void onFailure(Throwable caught) {
		}

		@Override
		public void onSuccess(SolverAllocatedMemoryRpcResponse result) {
			setWidget(new Label(result.getValue()));
		}
	});
}
 
Example 3
Project: unitimes   File: CourseNumbersSuggestBox.java   Source Code and License Vote up 6 votes
public static AriaSuggestBox insert(RootPanel panel) {
	String config = panel.getElement().getAttribute("configuration");
	final String onchange = panel.getElement().getAttribute("onchange");
	AriaTextBox text = new AriaTextBox(panel.getElement().getFirstChildElement());
	text.getElement().setAttribute("autocomplete", "off");
	AriaSuggestBox box = new AriaSuggestBox(text, new CourseNumbersSuggestBox(config));
	if (onchange != null)
		box.addValueChangeHandler(new ValueChangeHandler<String>() {
			@Override
			public void onValueChange(ValueChangeEvent<String> event) {
				ToolBox.eval(onchange);
			}
		});
	panel.add(box);
	return box;
}
 
Example 4
Project: unitimes   File: StudentScheduleTable.java   Source Code and License Vote up 6 votes
public void insert(final RootPanel panel) {
	String studentId = panel.getElement().getInnerText().trim();
	panel.getElement().setInnerText(null);
	panel.add(this);
	sSectioningService.lookupStudent(iOnline, studentId, new AsyncCallback<ClassAssignmentInterface.Student>() {
		@Override
		public void onSuccess(Student result) {
			if (result != null) {
				panel.setVisible(true);
				setStudent(result);
				if (SectioningCookie.getInstance().getEnrollmentCoursesDetails()) {
					refresh();
				} else {
					clear();
					iHeader.clearMessage();
					iHeader.setCollapsible(false);
				}
			}
		}
		@Override
		public void onFailure(Throwable caught) {}
	});
}
 
Example 5
Project: unitimes   File: ReservationTable.java   Source Code and License Vote up 6 votes
public void insert(final RootPanel panel) {
	initCallbacks();
	iOfferingId = Long.valueOf(panel.getElement().getInnerText());
	if (ReservationCookie.getInstance().getReservationCoursesDetails()) {
		refresh();
	} else {
		clear(false);
		iHeader.clearMessage();
		iHeader.setCollapsible(false);
	}
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
	addReservationClickHandler(new ReservationClickHandler() {
		@Override
		public void onClick(ReservationClickedEvent evt) {
			ToolBox.open(GWT.getHostPageBaseURL() + "gwt.jsp?page=reservation&id=" + evt.getReservation().getId() + "&reservations=" + getReservationIds());
		}
	});
}
 
Example 6
Project: empiria.player   File: ContentPreloader.java   Source Code and License Vote up 5 votes
public void setPreloader() {
    RootPanel preloaderWidget = rootPanelDelegate.getRootPanel(MAIN_PRELOADER_ID);
    if (preloaderWidget == null) {
        ImageResource progressImage = progressBundle.getProgressImage();
        mainPreloader = new Image(progressImage);
    } else {
        mainPreloader = Image.wrap(preloaderWidget.getElement());
    }
    RootPanel rootPanel = rootPanelDelegate.getRootPanel();
    rootPanel.add(mainPreloader);

    int halfWidth = windowDelegate.getClientWidth() / 2;
    int halfHeight = windowDelegate.getClientHeight() / 2;
    centerMainPreloader(halfWidth, halfHeight, mainPreloader.getElement());
}
 
Example 7
Project: unitimes   File: TeachingAssignmentsWidget.java   Source Code and License Vote up 5 votes
public void insert(final RootPanel panel) {
	iInstructorId = panel.getElement().getInnerText();
	if (InstructorCookie.getInstance().isShowTeachingAssignments()) {
		refresh();
	}
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
}
 
Example 8
Project: unitimes   File: TeachingRequestsWidget.java   Source Code and License Vote up 5 votes
public void insert(final RootPanel panel) {
	iOfferingId = Long.valueOf(panel.getElement().getInnerText());
	if (InstructorCookie.getInstance().isShowTeachingRequests()) {
		refresh();
	}
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
}
 
Example 9
Project: unitimes   File: CourseCurriculaTable.java   Source Code and License Vote up 5 votes
public void insert(final RootPanel panel) {
	initCallbacks();
	iOfferingId = Long.valueOf(panel.getElement().getInnerText());
	iCourseName = null;
	if (CurriculumCookie.getInstance().getCurriculaCoursesDetails()) {
		refresh();
	} else {
		iHeader.clearMessage();
		iHeader.setCollapsible(false);
	}
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
}
 
Example 10
Project: unitimes   File: SingleDateSelector.java   Source Code and License Vote up 5 votes
public static SingleDateSelector insert(RootPanel panel) {
	String format = panel.getElement().getAttribute("format");
	final String onchange = panel.getElement().getAttribute("onchange");
	String error = panel.getElement().getAttribute("error");
	AriaTextBox text = new AriaTextBox(panel.getElement().getFirstChildElement());
	SingleDateSelector selector = new SingleDateSelector(text, null, false);
	if (format != null)
		selector.iFormat = DateTimeFormat.getFormat(format);
	if (onchange != null)
		selector.addValueChangeHandler(new ValueChangeHandler<Date>() {
			@Override
			public void onValueChange(ValueChangeEvent<Date> event) {
				ToolBox.eval(onchange);
			}
		});
	if (text.getText() != null && !text.getText().isEmpty()) {
		Date date = null;
		try {
			date = selector.iFormat.parse(text.getText());
		} catch (IllegalArgumentException e) {}
		if (date != null)
			selector.setValue(date);
	}
	if (error != null && !error.isEmpty())
		selector.setErrorHint(error);
	panel.add(selector);
	return selector;
}
 
Example 11
Project: unitimes   File: EnrollmentTable.java   Source Code and License Vote up 5 votes
public void insert(final RootPanel panel) {
	iOfferingId = Long.valueOf(panel.getElement().getInnerText());
	if (iOfferingId >= 0 && iShowFilter)
		iHeader.setHeaderTitle(MESSAGES.studentsTable());
	if (SectioningCookie.getInstance().getEnrollmentCoursesDetails()) {
		refresh();
	} else {
		clear();
		iHeader.clearMessage();
		iHeader.setCollapsible(false);
	}
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
}
 
Example 12
Project: unitimes   File: UniTimePageLabel.java   Source Code and License Vote up 5 votes
public void insert(RootPanel panel) {
	String title = panel.getElement().getInnerText();
	if (title != null && !title.isEmpty())
		iLabel.setValue(new PageNameInterface(title));
	panel.getElement().setInnerText("");
	panel.add(iLabel);
	setPageName(title);
}
 
Example 13
Project: unitimes   File: RoomNoteChanges.java   Source Code and License Vote up 4 votes
public void insert(final RootPanel panel) {
	load(Long.valueOf(panel.getElement().getInnerText()));
	panel.getElement().setInnerText(null);
	panel.add(this);
	panel.setVisible(true);
}
 
Example 14
Project: unitimes   File: UniTimeVersion.java   Source Code and License Vote up 4 votes
public void insert(final RootPanel panel) {
	panel.add(this);
	panel.setVisible(true);
}
 
Example 15
Project: unitimes   File: UniTimeMobileMenu.java   Source Code and License Vote up 4 votes
private void attach(final RootPanel rootPanel) {
	rootPanel.add(this);
}
 
Example 16
Project: unitimes   File: UniTimePageHeader.java   Source Code and License Vote up 4 votes
public void insert(final RootPanel panel) {
	if (panel.getWidgetCount() > 0) return;
	panel.add(iHeader);
	panel.setVisible(true);
}