List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:com.audata.client.trays.TrayPanel.java
License:Open Source License
public void onLogout() { this.clear(); this.trays.clear(); Label l = new Label(LANG.no_trays_Text()); l.addStyleName("audoc-trayLabel"); this.add(l);//from www .ja v a 2 s .c o m }
From source file:com.audata.client.widgets.Wizard.java
License:Open Source License
public Wizard(String title, WizardListener listener) { this.listener = listener; this.values = new HashMap(); this.main = new VerticalPanel(); this.main.setHeight("100%"); this.main.setWidth("100%"); this.main.setSpacing(5); Label titleLabel = new Label(title); titleLabel.addStyleName("audoc-sectionTitle"); this.main.add(titleLabel); this.pages = new DeckPanel(); this.pages.setSize("100%", "100%"); this.main.add(this.pages); this.control = new HorizontalPanel(); this.control.setSpacing(5); this.control.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); this.control.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM); this.prev = new Button(LANG.previous_Text()); this.prev.addClickListener(this); this.prev.setVisible(false); this.next = new Button(LANG.next_Text()); this.next.addClickListener(this); this.finish = new Button(LANG.finish_Text()); this.finish.addClickListener(this); this.finish.setVisible(false); this.control.add(this.prev); this.control.add(this.next); this.control.add(this.finish); this.main.add(this.control); this.initWidget(this.main); this.setSize("100%", "100%"); }
From source file:com.axlight.gbrain.client.MainPane.java
License:Apache License
private void showAlertDialog(String message) { if (GBrain.isIPhone) { Window.alert(message);/*from w w w . j av a 2 s . co m*/ } else { final DialogBox dialog = new DialogBox(); dialog.setModal(true); dialog.setGlassEnabled(true); dialog.setText("Alert"); Label label = new Label(message); Button close = new Button("Close"); VerticalPanel basePanel = new VerticalPanel(); basePanel.setSpacing(10); basePanel.add(label); basePanel.add(close); dialog.add(basePanel); close.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialog.hide(); } }); dialog.center(); close.setFocus(true); } }
From source file:com.axlight.gbrain.client.MainPane.java
License:Apache License
private void showConfirmDialog(String message, final ClickHandler okHandler) { if (GBrain.isIPhone) { if (Window.confirm(message)) { okHandler.onClick(null);/* w w w. ja v a 2 s . c o m*/ } } else { final DialogBox dialog = new DialogBox(); dialog.setModal(true); dialog.setGlassEnabled(true); dialog.setText("Confirm"); Label label = new Label(message); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); Button ok = new Button("OK"); buttonPanel.add(ok); Button cancel = new Button("Cancel"); buttonPanel.add(cancel); VerticalPanel basePanel = new VerticalPanel(); basePanel.setSpacing(10); basePanel.add(label); basePanel.add(buttonPanel); dialog.add(basePanel); ok.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { okHandler.onClick(event); dialog.hide(); } }); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialog.hide(); } }); dialog.center(); } }
From source file:com.axlight.gbrain.client.MainPane.java
License:Apache License
private void showPromptDialog(String message, final PromptHandler promptHandler) { if (GBrain.isIPhone) { String input = Window.prompt(message, ""); if (input != null) { promptHandler.handleResult(input); }//from w ww. j ava2 s.com } else { final DialogBox dialog = new DialogBox(); dialog.setModal(true); dialog.setGlassEnabled(true); dialog.setText("Prompt"); Label label = new Label(message); final TextBox textBox = new TextBox(); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); Button ok = new Button("OK"); buttonPanel.add(ok); Button cancel = new Button("Cancel"); buttonPanel.add(cancel); VerticalPanel basePanel = new VerticalPanel(); basePanel.setSpacing(10); basePanel.add(label); basePanel.add(textBox); basePanel.add(buttonPanel); dialog.add(basePanel); ok.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { promptHandler.handleResult(textBox.getText()); dialog.hide(); } }); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialog.hide(); } }); dialog.center(); } }
From source file:com.badlogic.gdx.backends.gwt.GwtApplication.java
License:Apache License
void setupLoop() { // setup modules try {//from ww w . j a v a 2s . c o m graphics = new GwtGraphics(root, config); } catch (Throwable e) { root.clear(); root.add(new Label("Sorry, your browser doesn't seem to support WebGL")); return; } lastWidth = graphics.getWidth(); lastHeight = graphics.getHeight(); Gdx.app = this; Gdx.audio = new GwtAudio(); Gdx.graphics = graphics; Gdx.gl20 = graphics.getGL20(); Gdx.gl = Gdx.gl20; Gdx.files = new GwtFiles(preloader); this.input = new GwtInput(graphics.canvas); Gdx.input = this.input; this.net = new GwtNet(); Gdx.net = this.net; this.clipboard = new GwtClipboard(); // tell listener about app creation try { listener.create(); listener.resize(graphics.getWidth(), graphics.getHeight()); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); t.printStackTrace(); throw new RuntimeException(t); } AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() { @Override public void execute(double timestamp) { try { mainLoop(); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); throw new RuntimeException(t); } AnimationScheduler.get().requestAnimationFrame(this, graphics.canvas); } }, graphics.canvas); }
From source file:com.badlogic.gdx.backends.gwt.GwtApplicationCustom.java
License:Apache License
private void setupLoop() { // setup modules try {/* ww w .ja va2 s . co m*/ graphics = new GwtGraphics(root, config); graphics.setDisplayMode(480, 320, true); } catch (Throwable e) { root.clear(); root.add(new Label("Sorry, your browser doesn't seem to support WebGL")); return; } lastWidth = graphics.getWidth(); lastHeight = graphics.getHeight(); Gdx.app = this; Gdx.audio = new GwtAudio(); Gdx.graphics = graphics; Gdx.gl20 = graphics.getGL20(); Gdx.gl = graphics.getGLCommon(); Gdx.files = new GwtFiles(preloader); this.input = new GwtInput(graphics.canvas); Gdx.input = this.input; this.net = new GwtNet(); Gdx.net = this.net; // tell listener about app creation try { listener.create(); listener.resize(graphics.getWidth(), graphics.getHeight()); } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); t.printStackTrace(); throw new RuntimeException(t); } // setup rendering timer new Timer() { @Override public void run() { try { graphics.update(); if (Gdx.graphics.getWidth() != lastWidth || Gdx.graphics.getHeight() != lastHeight) { GwtApplicationCustom.this.listener.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); lastWidth = graphics.getWidth(); lastHeight = graphics.getHeight(); Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); } runnablesHelper.addAll(runnables); runnables.clear(); for (int i = 0; i < runnablesHelper.size; i++) { runnablesHelper.get(i).run(); } runnablesHelper.clear(); listener.render(); input.justTouched = false; } catch (Throwable t) { error("GwtApplication", "exception: " + t.getMessage(), t); throw new RuntimeException(t); } } }.scheduleRepeating((int) ((1f / config.fps) * 1000)); }
From source file:com.bedatadriven.renjin.appengine.client.CommandPrompt.java
License:Apache License
/** * This creates an immutable copy of the prompt and input area suitable for * adding to the page./*from w ww . ja va2 s . c o m*/ */ public Widget createImmutablePanel() { HorizontalPanel panelCopy = new HorizontalPanel(); Label promptCopy = new Label(prompt.getText()); promptCopy.setStyleName(prompt.getStyleName()); promptCopy.getElement().getStyle().setProperty("width", prompt.getElement().getStyle().getProperty("width")); panelCopy.add(promptCopy); final InterpreterType t = type; final String scriptText = inputArea.getText(); TextArea inputAreaCopy = new TextArea(); inputAreaCopy.setStyleName(inputArea.getStyleName()); inputAreaCopy.setText(removeTrailingNewLines(scriptText)); inputAreaCopy.setVisibleLines(countLines(inputArea)); inputAreaCopy.setReadOnly(true); SimplePanel inputAreaDivCopy = new SimplePanel(); inputAreaDivCopy.add(inputAreaCopy); inputAreaDivCopy.getElement().setAttribute("style", inputAreaDiv.getElement().getAttribute("style")); panelCopy.add(inputAreaDivCopy); panelCopy.setCellWidth(inputAreaDivCopy, "100%"); return panelCopy; }
From source file:com.blackducksoftware.tools.commonframework.core.gwt.ui.StandardLoginScreen.java
License:Open Source License
/** * Builds the server label.//w w w . j a v a 2 s . co m * * @return the label */ private Label buildServerLabel() { Label serverFieldLabel = new Label("Server:"); serverFieldLabel.setStyleName("gwt-Login-Label"); serverFieldLabel.setSize("51px", "21px"); return serverFieldLabel; }
From source file:com.blackducksoftware.tools.commonframework.core.gwt.ui.StandardLoginScreen.java
License:Open Source License
/** * Builds the user name label./* www. j a v a 2s . com*/ * * @return the label */ private Label buildUserNameLabel() { Label userFieldLabel = new Label("User:"); userFieldLabel.setStyleName("gwt-Login-Label"); userFieldLabel.setSize("38px", "21px"); return userFieldLabel; }