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

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project netnumeri, under directory /lib/appengine-java-sdk-1.6.0/demos/sticky/src/com/google/appengine/demos/sticky/client/.

Source file: Main.java

  22 
vote

public void onModelLoaded(Model model){
  status.hideTaskStatus();
  status.hideErrorStatus();
  final Images images=GWT.create(Images.class);
  Window.enableScrolling(false);
  final RootPanel root=RootPanel.get();
  new HeaderView(images,root,model);
  root.add(new SurfaceView(model));
}
 

Example 2

From project spring-me, under directory /spring-me-gwt-sample/src/main/java/me/springframework/gwtsample/client/.

Source file: Application.java

  22 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  final RootPanel rootPanel=RootPanel.get();
  final PolokoBeanFactory beanFactory=new PolokoBeanFactory();
  final Widget mainView=(Widget)beanFactory.getBean("mainView");
  rootPanel.add(mainView);
}
 

Example 3

From project XACML-Policy-Analysis-Tool, under directory /PolicyAnalysisTool/samples/DynaTable/src/com/google/gwt/sample/dynatable/client/.

Source file: DynaTable.java

  22 
vote

public void onModuleLoad(){
  RootPanel slot=RootPanel.get("calendar");
  if (slot != null) {
    SchoolCalendarWidget calendar=new SchoolCalendarWidget(15);
    slot.add(calendar);
    slot=RootPanel.get("days");
    if (slot != null) {
      DayFilterWidget filter=new DayFilterWidget(calendar);
      slot.add(filter);
    }
  }
}
 

Example 4

From project play-gwt2, under directory /samples/gwt2chat/app/gwt/longPolling/client/.

Source file: Longpolling.java

  21 
vote

public void onModuleLoad(){
  RootPanel chat=RootPanel.get("chat");
  user=AppHelper.getUserFromPage();
  if (user == null)   user="Guest";
  threadPanel=new ThreadPanel();
  chat.add(threadPanel);
  newMessagePanel=new NewMessagePanel();
  newMessagePanel.addSendMessageListener(new SendMessageListener(){
    @Override public void onSend(    SendMessageEvent event){
      chatRoom.say(event.getMessage(),user,new AsyncCallback<List<Void>>(){
        @Override public void onSuccess(        List<Void> result){
        }
        @Override public void onFailure(        Throwable caught){
        }
      }
);
    }
  }
);
  chat.add(newMessagePanel);
  lastReceived=new Long(0);
  chatRoom.waitMessages(lastReceived,new GetMessages());
}
 

Example 5

From project Socket.IO-Java, under directory /samples/chat-gwt/src/main/java/com/glines/socketio/sample/gwtchat/client/.

Source file: GWTChatClient.java

  21 
vote

public void onModuleLoad(){
  RootPanel rootPanel=RootPanel.get();
  rootPanel.setSize("800","300");
  htmlPanel=new HTML("Connecting...");
  htmlPanel.setStyleName("chat");
  rootPanel.add(htmlPanel);
  submitPanel=new FlowPanel();
  submitPanel.setStyleName("submitPanel");
  rootPanel.add(submitPanel);
  submitPanel.setWidth("800");
  submitPanel.setVisible(false);
  textBox=new TextBox();
  textBox.setVisibleLength(109);
  textBox.addKeyPressHandler(new KeyPressHandler(){
    public void onKeyPress(    KeyPressEvent event){
      if (event.getCharCode() == KeyCodes.KEY_ENTER) {
        onSubmit();
      }
    }
  }
);
  textBox.setSize("","30");
  submitPanel.add(textBox);
  Button btnSubmit=new Button("Submit");
  btnSubmit.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      onSubmit();
    }
  }
);
  btnSubmit.setHeight("30");
  submitPanel.add(btnSubmit);
  socket=GWTSocketIOConnectionFactory.INSTANCE.create(this,null,(short)0);
  socket.connect();
}
 

Example 6

From project tocollege.net, under directory /src/main/java/com/apress/progwt/client/.

Source file: GWTApp.java

  21 
vote

public GWTApp(int pageID){
  this.pageID=pageID;
  try {
    RootPanel status=RootPanel.get("gwt-status");
    if (status.getWidgetCount() == 0) {
      StatusPanel sp=new StatusPanel();
      status.add(sp);
      StdAsyncCallback.setManager(sp);
    }
  }
 catch (  Exception e) {
    Log.error("Status Panel problem: ");
  }
  new Timer(){
    @Override public void run(){
      try {
        doLocalServer();
      }
 catch (      Exception e) {
        Log.warn("LocalServer exception: " + e);
      }
    }
  }
.schedule(10000);
}
 

Example 7

From project Caronas, under directory /src/main/java/parceirosDaEstrada/web/client/paineis/.

Source file: PainelMenu.java

  19 
vote

public void execute(){
  try {
    ParceirosDaEstrada home=ParceirosDaEstrada.getInstance();
    SistemaWebMain.getSistema().encerrarSessao(login);
    RootPanel.get().clear();
    home.onModuleLoad();
  }
 catch (  Exception e) {
    Window.alert(e.getMessage() + "!");
  }
}
 

Example 8

From project data-access, under directory /src/org/pentaho/platform/dataaccess/datasource/ui/importing/.

Source file: AnalysisImportDialogController.java

  19 
vote

private void reset(){
  analysisFileLabel.setValue(resBundle.getString("importDialog.IMPORT_MONDRIAN","Browse for analysis file"));
  if (formPanel != null && RootPanel.get().getWidgetIndex(formPanel) != -1) {
    RootPanel.get().remove(formPanel);
  }
  formPanel=null;
  submitHandler=null;
  reloadConnections();
  importDialogModel.removeAllParameters();
  importDialogModel.setUploadedFile(null);
  availableRadio.setSelected(true);
  acceptButton.setDisabled(true);
  schemaNameLabel.setValue("");
  setPreference(DATASOURCE_MODE);
  overwrite=false;
  removeHiddenPanels();
}
 

Example 9

From project exo-training, under directory /gxt-showcase/src/main/java/com/sencha/gxt/desktop/client/widget/.

Source file: StartMenu.java

  19 
vote

/** 
 * Hides the start menu.
 */
public void hide(){
  if (showing) {
    if (fireCancellableEvent(new BeforeHideEvent())) {
      showing=false;
      onHide();
      RootPanel.get().remove(this);
      eventPreview.remove();
      fireEvent(new HideEvent());
    }
  }
}
 

Example 10

From project GKEngine, under directory /main/gk/src/org/gk/client/.

Source file: GKEngine.java

  19 
vote

@Override public void start(){
  if (hasRenderPageFunction()) {
    RootPanel.get().add(viewport);
  }
  gk=Engine.get();
  Timer timer=new Timer(){
    @Override public void run(){
      if (gk.isReady()) {
        cancel();
        registry(GKEngine.this,gk);
      }
    }
  }
;
  timer.scheduleRepeating(200);
}
 

Example 11

From project gwt-bootstrap, under directory /src/main/java/com/github/gwtbootstrap/client/ui/.

Source file: Modal.java

  19 
vote

/** 
 * {@inheritDoc}
 */
public void show(){
  if (!this.isAttached()) {
    RootPanel.get().add(this);
  }
  changeVisibility("show");
}
 

Example 12

From project gwt-maven-plugin, under directory /src/it/compile/src/main/java/com/google/gwt/sample/hello/client/.

Source file: Hello.java

  19 
vote

public void onModuleLoad(){
  Button b=new Button("Click me",new ClickListener(){
    public void onClick(    Widget sender){
      Window.alert("Hello, AJAX");
    }
  }
);
  RootPanel.get().add(b);
}
 

Example 13

From project gwt-three.js-test, under directory /src/com/akjava/gwt/three/client/gwt/.

Source file: MultiImageLoader.java

  19 
vote

public void startLoad(){
  geometries=new HashMap<String,Image>();
  remains=new ArrayList<String>();
  for (  String name : lists.keySet()) {
    remains.add(name);
  }
  for (  String name : lists.keySet()) {
    String path=lists.get(name);
    Image img=new Image(lists.get(name));
    img.setVisible(false);
    RootPanel.get().add(img);
    img.addLoadHandler(new Loaded(img,name));
  }
}
 

Example 14

From project gwtphonegap, under directory /src/main/java/com/googlecode/gwtphonegap/client/plugins/childbrowser/.

Source file: ChildBrowserBrowserImpl.java

  19 
vote

@Override public void showWebPage(String url){
  removePanel();
  if (browser == null) {
    browser=new Browser();
  }
  if (!browser.isAttached()) {
    RootPanel.get().add(browser);
  }
  browser.navigate(url);
}
 

Example 15

From project harmony, under directory /harmony.ui.webgui/src/client/.

Source file: ManagementGui.java

  19 
vote

/** 
 * Build the whole panel.
 */
public final void onModuleLoad(){
  ManagementGui.instance=this;
  this.logoPanel.setWidth("100%");
  this.rightPanel.addStyleName("rightPanel");
  this.rightPanel.setWidth("100%");
  this.resTree.addStyleName("treeMenu");
  this.topologyTree.addStyleName("treeMenu");
  this.argonTree.addStyleName("treeMenu");
  this.stackPanel.setWidth("200");
  this.stackPanel.add(this.resTree,this.createImageHtml("journal.png","Reservation"),true);
  this.stackPanel.add(this.topologyTree,this.createImageHtml("connect.png","Tools"),true);
  this.stackPanel.add(this.argonTree,this.createImageHtml("database.png","Argon"),true);
  this.stackPanel.add(this.renameTree,"About",true);
  this.dock.add(this.logoPanel,DockPanel.NORTH);
  this.dock.add(LoggingPanel.getPanel(),DockPanel.SOUTH);
  this.dock.add(this.stackPanel,DockPanel.WEST);
  this.dock.add(this.rightPanel,DockPanel.CENTER);
  this.dock.setWidth("100%");
  this.dock.setSpacing(4);
  this.dock.setCellWidth(this.rightPanel,"100%");
  Window.addWindowResizeListener(this);
  Window.enableScrolling(true);
  Window.setMargin("0px");
  RootPanel.get().add(this.dock);
  DeferredCommand.addCommand(new Command(){
    public void execute(){
      ManagementGui.this.onWindowResized(Window.getClientWidth(),Window.getClientHeight());
    }
  }
);
  this.onWindowResized(Window.getClientWidth(),Window.getClientHeight());
}
 

Example 16

From project huiswerk, under directory /print/zxing-1.6/zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/.

Source file: Generator.java

  19 
vote

public void onModuleLoad(){
  loadGenerators();
  HorizontalPanel mainPanel=new HorizontalPanel();
  setupLeftPanel();
  topPanel.getElement().setId("leftpanel");
  Widget leftPanel=topPanel;
  mainPanel.add(leftPanel);
  SimplePanel div=new SimplePanel();
  SimplePanel div2=new SimplePanel();
  div2.add(result);
  div2.getElement().setId("innerresult");
  div.add(div2);
  div.getElement().setId("imageresult");
  urlResult.getElement().setId("urlresult");
  downloadText.getElement().setId("downloadText");
  rightPanel.add(div);
  rightPanel.add(downloadText);
  rightPanel.add(urlResult);
  mainPanel.add(rightPanel);
  mainPanel.getElement().setId("mainpanel");
  RootPanel.get("ui").add(mainPanel);
  setWidget(1);
  invalidateBarcode();
}
 

Example 17

From project iserve, under directory /iserve-parent/iserve-sal-gwt/src/main/java/uk/ac/open/kmi/iserve/sal/gwt/client/.

Source file: iServeBrowser.java

  19 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  viewport=new Viewport();
  viewport.setLayout(new BorderLayout());
  createHeaderPanel();
  createNavigatorPanel();
  createCentrePanel();
  RootPanel.get().add(viewport);
  validateSession();
}
 

Example 18

From project james-hupa, under directory /client/src/main/java/org/apache/hupa/client/.

Source file: Hupa.java

  19 
vote

public void onModuleLoad(){
  com.google.gwt.user.client.Element loading=DOM.getElementById("loading");
  DOM.removeChild(RootPanel.getBodyElement(),loading);
  AppPresenter aPres=injector.getAppPresenter();
  aPres.bind();
  RootPanel.get().add(aPres.getDisplay().asWidget());
  PlaceManager placeManager=injector.getPlaceManager();
  placeManager.fireCurrentPlace();
}
 

Example 19

From project java-maven-tests, under directory /src/gwt-best-practices/src/main/java/com/truward/gbp/client/.

Source file: Application.java

  19 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  final AppServiceAsync appService=GWT.create(AppService.class);
  final HandlerManager eventBus=new HandlerManager(null);
  final HasWidgets rootPanel=RootPanel.get();
  final LoginController loginController=new LoginController(appService,eventBus);
  loginController.start(rootPanel);
}
 

Example 20

From project jbpm-form-builder, under directory /jbpm-gwt-form-api/src/main/java/org/jbpm/formapi/common/panels/.

Source file: ConfirmDialog.java

  19 
vote

public ConfirmDialog(String warningText){
  super(false,true);
  warning.setText(warningText);
  VerticalPanel panel=new VerticalPanel();
  panel.add(warning);
  HorizontalPanel buttons=new HorizontalPanel();
  Button cancelButton=new Button("Cancel");
  cancelButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      hide();
    }
  }
);
  okButton.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      hide();
    }
  }
);
  buttons.add(okButton);
  buttons.add(cancelButton);
  panel.add(buttons);
  add(panel);
  int height=RootPanel.getBodyElement().getClientHeight();
  int width=RootPanel.getBodyElement().getClientWidth();
  setSize("300px","100px");
  setPopupPosition(width / 2 - 150,height / 2 - 50);
}
 

Example 21

From project kevoree-library, under directory /javase/org.kevoree.library.javase.webserver.aceEditor/src/main/java/org/kevoree/library/javase/webserver/latexEditor/client/.

Source file: latexEditor.java

  19 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  fileExplorer=new latexEditorFileExplorer();
  VerticalPanel leftBar=new VerticalPanel();
  Button btCompile=new Button();
  btCompile.setText("Generate PDF");
  btCompile.setStyleName("btn");
  btCompile.addStyleName("primary");
  btCompile.addStyleName("small");
  btCompile.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      latexEditorRPC.callForCompile(fileExplorer);
    }
  }
);
  Button btDefault=new Button();
  btDefault.setText("Set main file");
  btDefault.setStyleName("btn");
  btDefault.addStyleName("primary");
  btDefault.addStyleName("small");
  btDefault.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      fileExplorer.setSelectAsDefault();
    }
  }
);
  HorizontalPanel bts=new HorizontalPanel();
  bts.setBorderWidth(0);
  bts.add(btCompile);
  bts.add(btDefault);
  leftBar.add(bts);
  ScrollPanelWrapper scrollP=new ScrollPanelWrapper(fileExplorer);
  leftBar.add(scrollP);
  RootPanel.get("files").add(leftBar);
}
 

Example 22

From project LanguageSpecCreator, under directory /src/liber/browse/client/.

Source file: WYSIWYMinterface.java

  19 
vote

/** 
 * Display browsing module
 */
private void init(){
  waitPanel.setWidget(new VerticalPanel());
  waitPanel.setPopupPosition(Window.getClientWidth(),Window.getClientHeight());
  showHourglass();
  wt=new WysiwymTab(this);
  RootPanel.get().add(wt);
  wt.init();
}
 

Example 23

From project lib-gwt-svg, under directory /src/main/java/org/vectomatic/dom/svg/utils/.

Source file: IFrameXmlLoader.java

  19 
vote

public void loadResource(String resourceName,AsyncXmlLoaderCallback callback){
  IFrameElement iframe=Document.get().createIFrameElement();
  iframe.setAttribute("tabIndex","-1");
  iframe.setAttribute("style","position: absolute; width: 0; height: 0; border: 0");
  iframe.setAttribute("src","javascript:''");
  Element body=RootPanel.get().getElement();
  body.appendChild(iframe);
  setFrameLocation(resourceName,iframe,callback);
}
 

Example 24

From project maven-gae-plugin, under directory /gae-archetype-gwt/src/main/resources/archetype-resources/src/main/java/net/kindleit/gae/example/client/.

Source file: IndexPage.java

  19 
vote

/** 
 * @see com.google.gwt.core.client.EntryPoint#onModuleLoad()
 */
@Override public void onModuleLoad(){
  RootPanel.getBodyElement().removeChild(DOM.getElementById("Loading-Message"));
  Shoutbox shoutbox=new Shoutbox();
  shoutbox.setHeader("Welcome to Google App Engine for Java!");
  RootPanel.get().add(shoutbox);
}
 

Example 25

From project maven3-support, under directory /maven3-plugin/src/main/java/org/hudsonci/maven/plugin/ui/gwt/buildinfo/.

Source file: MavenBuildInfoEntryPoint.java

  19 
vote

/** 
 * The new GWT layout panels are being used which require size/resize  notifications to operate correctly to fill the page. RootLayoutPanel  should be the used when GWT controls the entire page. RootPanel does not give these layout hints but it must be used to attach to an existing element in the page (via div in this case).  When using  RootPanel directly we need to set the height for the parent and the  MainPanel as well as set it in the host page container div. An easier approach is to add a LayoutPanel to the RootPanel and then use that LayoutPanel as the container for the application.  In this way resizing is accurate and we can attach to an existing page element; and hopefully the rest of the app widgets will have to fuss with 100% sizing provided they're used in the new layout containers that support accurate resizing. Refer to the GWT documentation for more information: http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#LayoutPanels
 * @return the panel to attach the application to 
 */
private Panel getPagePanel(){
  LayoutPanel panel=new LayoutPanel();
  panel.setSize("100%","100%");
  RootPanel.get("maven3-buildInfoPanel").add(panel);
  return panel;
}
 

Example 26

From project MEditor, under directory /editor-request/src/main/java/cz/mzk/editor/request4Adding/client/.

Source file: RequestForAdding.java

  19 
vote

private void callServer(){
  if (process) {
    final RequestConstants lang=GWT.create(RequestConstants.class);
    final RequestForAddingServiceAsync service=GWT.create(RequestForAddingService.class);
    AsyncCallback<String> callback=new AsyncCallback<String>(){
      @Override public void onFailure(      Throwable caught){
      }
      @Override public void onSuccess(      String result){
        if (process && result != null && !"".equals(result)) {
          process=false;
          RootPanel.get().add(showGUI(result,lang,service));
        }
      }
    }
;
    service.getName(callback);
  }
}
 

Example 27

From project mgwt, under directory /src/main/java/com/googlecode/mgwt/ui/client/dialog/.

Source file: AnimatableDialogBase.java

  19 
vote

/** 
 * get the panel that the dialog overlays
 * @return the panel that is overlayed by this dialog
 */
public HasWidgets getPanelToOverlay(){
  if (panelToOverlay == null) {
    panelToOverlay=RootPanel.get();
  }
  return panelToOverlay;
}
 

Example 28

From project mgwt.showcase, under directory /src/main/java/com/googlecode/mgwt/examples/showcase/client/.

Source file: ShowCaseEntryPoint.java

  19 
vote

private void createPhoneDisplay(ClientFactory clientFactory){
  AnimatableDisplay display=GWT.create(AnimatableDisplay.class);
  PhoneActivityMapper appActivityMapper=new PhoneActivityMapper(clientFactory);
  PhoneAnimationMapper appAnimationMapper=new PhoneAnimationMapper();
  AnimatingActivityManager activityManager=new AnimatingActivityManager(appActivityMapper,appAnimationMapper,clientFactory.getEventBus());
  activityManager.setDisplay(display);
  RootPanel.get().add(display);
}
 

Example 29

From project Mobile-Tour-Guide, under directory /zxing-2.0/zxing.appspot.com/src/com/google/zxing/web/generator/client/.

Source file: Generator.java

  19 
vote

@Override public void onModuleLoad(){
  loadGenerators();
  HorizontalPanel mainPanel=new HorizontalPanel();
  setupLeftPanel();
  topPanel.getElement().setId("leftpanel");
  Widget leftPanel=topPanel;
  mainPanel.add(leftPanel);
  SimplePanel div=new SimplePanel();
  SimplePanel div2=new SimplePanel();
  div2.add(result);
  div2.getElement().setId("innerresult");
  div.add(div2);
  div.getElement().setId("imageresult");
  urlResult.getElement().setId("urlresult");
  rawTextResult.getElement().setId("rawtextresult");
  rawTextResult.setCharacterWidth(50);
  rawTextResult.setVisibleLines(8);
  downloadText.getElement().setId("downloadText");
  rightPanel.add(div);
  rightPanel.add(downloadText);
  rightPanel.add(urlResult);
  rightPanel.add(rawTextResult);
  mainPanel.add(rightPanel);
  mainPanel.getElement().setId("mainpanel");
  RootPanel.get("ui").add(mainPanel);
  setWidget(1);
  invalidateBarcode();
}
 

Example 30

From project modeler, under directory /src/org/pentaho/agilebi/modeler/gwt/.

Source file: GwtModelerEntryPoint.java

  19 
vote

public void xulLoaded(GwtXulRunner gwtXulRunner){
  IModelerMessages messages=new GwtModelerMessages((ResourceBundle)gwtXulRunner.getXulDomContainers().get(0).getResourceBundles().get(0));
  BogoPojo bogo=new BogoPojo();
  XulDomContainer container=gwtXulRunner.getXulDomContainers().get(0);
  GwtModelerWorkspaceHelper helper=new GwtModelerWorkspaceHelper();
  ModelerWorkspace model=new ModelerWorkspace(helper);
  model.setDomain(this.domain);
  ModelerController controller=new ModelerController(model);
  controller.setWorkspaceHelper(helper);
  try {
    ModelerMessagesHolder.setMessages(messages);
  }
 catch (  IllegalStateException e) {
  }
  BindingFactory bf=new GwtBindingFactory(container.getDocumentRoot());
  controller.setBindingFactory(bf);
  container.addEventHandler(controller);
  ModelerUiHelper.configureControllers(container,model,bf,controller,new ColResolverController());
  RootPanel.get().add((Widget)container.getDocumentRoot().getRootElement().getManagedObject());
  try {
    gwtXulRunner.initialize();
  }
 catch (  XulException e) {
    e.printStackTrace();
  }
}
 

Example 31

From project next-demo, under directory /src/next/interfaces/.

Source file: Main.java

  19 
vote

public void onModuleLoad(){
  Scheduler.get().scheduleDeferred(new ScheduledCommand(){
    @Override public void execute(){
      XTabController tabAnimeCtrl=new XTabController(new XNavigationController(new AnimationsController()));
      tabAnimeCtrl.set("Animations",new Image("images/icons/tab0.png"),new Image("images/icons/tab0-selected.png"));
      XTabController tabWidgetsCtrl=new XTabController(new XNavigationController(new WidgetsController()));
      tabWidgetsCtrl.set("Widgets",new Image("images/icons/tab3.png"),new Image("images/icons/tab3-selected.png"));
      XTabBarController tabBarController=new XTabBarController();
      tabBarController.addControllers(tabWidgetsCtrl,tabAnimeCtrl);
      tabBarController.attach(RootLayoutPanel.get());
      RootPanel.get("loading").setVisible(false);
      new HistoryController().register("start");
    }
  }
);
}
 

Example 32

From project nuxeo-opensocial, under directory /nuxeo-opensocial-container/src/main/java/org/nuxeo/opensocial/container/client/.

Source file: Container.java

  19 
vote

public void onModuleLoad(){
  MessagePresenter messagePresenter=injector.getMessagePresenter();
  messagePresenter.bind();
  messagePresenter.revealDisplay();
  AppPresenter appPresenter=injector.getAppPresenter();
  appPresenter.bind();
  appPresenter.revealDisplay();
  rootPanel.add(appPresenter.getDisplay().asWidget());
  RootPanel.get().add(messagePresenter.getDisplay().asWidget());
}
 

Example 33

From project org.ops4j.pax.web, under directory /pax-web-archetypes/wab-gwt-archetype/src/main/resources/archetype-resources/src/main/java/com/mycompany/gwt/client/.

Source file: HelloGwt.java

  19 
vote

@Override public void onModuleLoad(){
  Label label=new Label("Hello GWT !!!");
  Button button=new Button("Say something");
  button.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      Window.alert("Hello, again");
    }
  }
);
  RootPanel.get().add(label);
  RootPanel.get().add(button);
}
 

Example 34

From project osw-web, under directory /src/org/onesocialweb/gwt/client/ui/application/.

Source file: AbstractApplication.java

  19 
vote

public void show(){
  onShow();
  if (!isAttached()) {
    RootPanel.get("applicationwrapper").add(appContainer);
    appContainer.setHeight("100%");
    appContainer.setStyleName("application");
  }
  setVisible(true);
  for (  AbstractWindow w : windows.values()) {
    w.show();
  }
}
 

Example 35

From project powerSimulator, under directory /src/no/silvergrass/sysut/client/.

Source file: HelloWorld.java

  19 
vote

public void loadMenu(){
  inputPageButton=new Button("Input page");
  errorLabel=new Label();
  RootPanel.get("sendButtonContainer").add(inputPageButton);
  RootPanel.get("errorLabelContainer").add(errorLabel);
  handle=new MyOnClickHandler();
  inputPageButton.addClickHandler(handle);
}
 

Example 36

From project projectsonar, under directory /src/edu/kit/ipd/sonar/client/.

Source file: GuiController.java

  19 
vote

/** 
 * This is the entry point method.
 */
public final void onModuleLoad(){
  new RPCHandler(EventBus.getHandlerManager(),(RPCServiceAsync)GWT.create(RPCService.class));
  LoadingPopup loadingPopup=new LoadingPopup();
  EventBus.getHandlerManager().fireEvent(new StartLoadingEvent());
  ErrorPopup errorPopup=new ErrorPopup();
  GraphConverter graphconverter=new GraphConverter(EventBus.getHandlerManager());
  deckPanel.add(new NormalScreen());
  deckPanel.add(new LoginScreen());
  deckPanel.showWidget(LOGIN_SCREEN);
  RootPanel.get().add(deckPanel);
  HandlerManager hm=EventBus.getHandlerManager();
  hm.addHandler(SuccessfulAuthenticationEvent.TYPE,new SuccessfulAuthenticationEventHandler(){
    public void onSuccessfulAuthentication(    final SuccessfulAuthenticationEvent e){
      GWT.log("GuiController: got auth event, switching" + " to normal screen",null);
      deckPanel.showWidget(NORMAL_SCREEN);
    }
  }
);
  hm.addHandler(SuccessfulLogoutEvent.TYPE,new SuccessfulLogoutEventHandler(){
    public void onSuccessfulLogout(    final SuccessfulLogoutEvent e){
      GWT.log("GuiController: got logout event, switching" + " to login screen",null);
      deckPanel.showWidget(LOGIN_SCREEN);
    }
  }
);
  EventBus.getHandlerManager().fireEvent(new FinishLoadingEvent());
}
 

Example 37

From project resty-gwt, under directory /restygwt/src/it/restygwt-example/src/main/java/org/fusesource/restygwt/examples/client/.

Source file: UI.java

  19 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  Button button=new Button("Place Pizza Order");
  button.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      placeOrder();
    }
  }
);
  RootPanel.get().add(button);
  button=new Button("Do Put");
  button.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      doPut();
    }
  }
);
  RootPanel.get().add(button);
  button=new Button("Do A Search on Yahoo /w Jsonp");
  button.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent event){
      doJsonp();
    }
  }
);
  RootPanel.get().add(button);
}
 

Example 38

From project sandbox, under directory /xmpp/xwiki-xmpp-gwt/src/main/java/org/xwiki/platform/client/.

Source file: Application.java

  19 
vote

/** 
 * This is the entry point method.
 */
public void onModuleLoad(){
  ContactsWidget cw=new ContactsWidget();
  cw.add("Asiri Rathnayake");
  cw.add("Ludovic Dubost");
  cw.add("Sergiu Dumitriu");
  cw.add("Harsha Sanjeewa");
  cw.add("Fred Nassel");
  cw.add("Naveen Sathsara");
  RootPanel.get("container").add(cw);
}
 

Example 39

From project scalagwt-sample, under directory /src/com/google/gwt/sample/showcase/client/.

Source file: StyleSheetLoader.java

  19 
vote

/** 
 * Create a new  {@link StyleTesterTimer}.
 * @param refStyleName the reference style name
 * @param callback the callback to execute when the style sheet loads
 */
public StyleTesterTimer(String refStyleName,Command callback){
  this.callback=callback;
  refWidget=new Label();
  refWidget.setStyleName(refStyleName);
  refWidget.getElement().getStyle().setProperty("position","absolute");
  refWidget.getElement().getStyle().setProperty("visibility","hidden");
  refWidget.getElement().getStyle().setProperty("display","inline");
  refWidget.getElement().getStyle().setPropertyPx("padding",0);
  refWidget.getElement().getStyle().setPropertyPx("margin",0);
  refWidget.getElement().getStyle().setPropertyPx("border",0);
  refWidget.getElement().getStyle().setPropertyPx("top",0);
  refWidget.getElement().getStyle().setPropertyPx("left",0);
  RootPanel.get().add(refWidget);
}
 

Example 40

From project socialpm, under directory /gwt/src/main/java/com/ocpsoft/socialpm/gwt/client/local/.

Source file: App.java

  19 
vote

@PostConstruct public void setup(){
  EventBus eventBus=clientFactory.getEventBus();
  PlaceController placeController=clientFactory.getPlaceController();
  ActivityManager activityManager=new ActivityManager(historyMapper,eventBus);
  activityManager.setDisplay(app);
  final PlaceHistoryHandler historyHandler=new PlaceHistoryHandler(historyMapper);
  historyHandler.register(placeController,eventBus,defaultPlace);
  RootPanel.get("rootPanel").add(app);
  CDI.addPostInitTask(new Runnable(){
    @Override public void run(){
      clientFactory.getServiceFactory().getAuthService().call(new RemoteCallback<Profile>(){
        @Override public void callback(        Profile profile){
          if (profile != null) {
            clientFactory.getEventFactory().fireLoginEvent(profile);
          }
          historyHandler.handleCurrentHistory();
        }
      }
).getLoggedInProfile();
    }
  }
);
}
 

Example 41

From project tsdash, under directory /ui/src/com/facebook/tsdb/tsdash/client/.

Source file: ApplicationController.java

  19 
vote

public void go(){
  this.topContainer=RootPanel.get("topmenu");
  this.viewContainer=RootPanel.get("content");
  this.errorContainer=RootPanel.get("error");
  fireInit();
}
 

Example 42

From project tvguide-sample-parent, under directory /tvguide-client/src/main/attic/com/acme/gwt/attic/.

Source file: PartnerLogin.java

  19 
vote

private void proceed(String sessionID){
  System.err.println("proceeding");
  RootPanel.get("loginDiv").setVisible(false);
  final TabPanel mainTabs=new TabPanel();
  mainTabs.setAnimationEnabled(true);
  RootPanel.get().add(mainTabs);
  final String[] tabNames={"Kiosk","MerchantGateway","ProductModel","Contact","Charge","Rental","Adam","Slot","SlotEvent"};
  for (  String tabTitle : tabNames) {
    addEditorPanel(tabTitle,mainTabs,sessionID);
  }
  mainTabs.addSelectionHandler(new SelectionHandler<Integer>(){
    @Override public void onSelection(    SelectionEvent<Integer> integerSelectionEvent){
      History.newItem(tabNames[integerSelectionEvent.getSelectedItem()]);
    }
  }
);
  History.addValueChangeHandler(new ValueChangeHandler<String>(){
    @Override public void onValueChange(    ValueChangeEvent<String> stringValueChangeEvent){
      System.err.println("firing history change");
    }
  }
);
}
 

Example 43

From project yanel, under directory /src/build/resource-types/GWT-src-core-java/org/wyona/yanel/gwt/client/.

Source file: ConfigurableComponentsAware.java

  19 
vote

/** 
 * Looks for configured panels.
 * @return root panels as specified in the configuration. Note that some root panels may be <code>null</code> when it is not found
 */
public final RootPanel[] getRootPanels(){
  if (panels == null) {
    panels=new RootPanel[getConfigurationSize()];
    for (int i=0; i < panels.length; i++) {
      panels[i]=RootPanel.get(getConfiguration(getComponentHolderIdentifyingParameter(),i));
    }
  }
  return panels;
}
 

Example 44

From project zanata, under directory /zanata-war/src/main/java/org/zanata/webtrans/client/.

Source file: Application.java

  19 
vote

private void delayedStartApp(){
  final AppPresenter appPresenter=injector.getAppPresenter();
  final DocumentListPresenter documentListPresenter=injector.getDocumentListPresenter();
  RootPanel.get("contentDiv").add(appPresenter.getDisplay().asWidget());
  appPresenter.bind();
  Window.enableScrolling(true);
  final EventBus eventBus=injector.getEventBus();
  injector.getDispatcher().execute(new GetDocumentList(getWorkspaceId().getProjectIterationId(),injector.getLocation().getQueryDocuments()),new AsyncCallback<GetDocumentListResult>(){
    @Override public void onFailure(    Throwable caught){
      eventBus.fireEvent(new NotificationEvent(NotificationEvent.Severity.Error,"Failed to load documents"));
    }
    @Override public void onSuccess(    GetDocumentListResult result){
      long start=System.currentTimeMillis();
      final ArrayList<DocumentInfo> documents=result.getDocuments();
      Log.info("Received doc list for " + result.getProjectIterationId() + ": "+ documents.size()+ " elements, loading time: "+ String.valueOf(System.currentTimeMillis() - start)+ "ms");
      documentListPresenter.setDocuments(documents);
      History history=injector.getHistory();
      history.addValueChangeHandler(injector.getHistoryEventHandlerService());
      Log.info("=========== now firing current history state =========== ");
      history.fireCurrentHistoryState();
      start=System.currentTimeMillis();
      TranslationStats projectStats=new TranslationStats();
      for (      DocumentInfo doc : documents) {
        projectStats.add(doc.getStats());
      }
      documentListPresenter.setProjectStats(projectStats);
      Log.info("Time to calculate project stats: " + String.valueOf(System.currentTimeMillis() - start) + "ms");
      eventBus.fireEvent(new ProjectStatsUpdatedEvent(projectStats));
    }
  }
);
}
 

Example 45

From project zmachine, under directory /src/de/lilawelt/zmachine/client/.

Source file: Machine.java

  19 
vote

public void onModuleLoad(){
  singleton=this;
  Dictionary parameters=Dictionary.getDictionary("Parameters");
  String selector=parameters.get("selector");
  Element loading=DOM.getElementById("loading");
  if (loading != null) {
    DOM.removeChild(RootPanel.getBodyElement(),loading);
  }
  r=RootPanel.get();
  if (selector.equals("base")) {
    s=new StorySelector();
    r.add(s);
  }
 else   if (selector.equals("url")) {
    String url=parameters.get("url");
    String storyuid=parameters.get("uid");
    loadStory("/Proxy?url=" + url,storyuid);
  }
 else   if (selector.equals("urlselector")) {
    s=new UrlSelector();
    r.add(s);
  }
 else   if (selector.equals("playstory")) {
    String storyname=parameters.get("name");
    String storyuid=parameters.get("uid");
    Log.debug("Loading: " + storyname);
    loadStory("/store/" + storyname + ".sto",storyuid);
  }
 else   if (selector.equals("offline")) {
    OfflineMenuImpl menu=OfflineMenu.get();
    menu.initialize();
    s=menu;
    r.add(s);
  }
  ContextMenu c=new ContextMenu();
  Event.addNativePreviewHandler(c);
}
 

Example 46

From project zxing, under directory /zxing.appspot.com/src/com/google/zxing/web/generator/client/.

Source file: Generator.java

  19 
vote

@Override public void onModuleLoad(){
  loadGenerators();
  HorizontalPanel mainPanel=new HorizontalPanel();
  setupLeftPanel();
  topPanel.getElement().setId("leftpanel");
  Widget leftPanel=topPanel;
  mainPanel.add(leftPanel);
  SimplePanel div=new SimplePanel();
  SimplePanel div2=new SimplePanel();
  div2.add(result);
  div2.getElement().setId("innerresult");
  div.add(div2);
  div.getElement().setId("imageresult");
  urlResult.getElement().setId("urlresult");
  rawTextResult.getElement().setId("rawtextresult");
  rawTextResult.setCharacterWidth(50);
  rawTextResult.setVisibleLines(8);
  downloadText.getElement().setId("downloadText");
  rightPanel.add(div);
  rightPanel.add(downloadText);
  rightPanel.add(urlResult);
  rightPanel.add(rawTextResult);
  mainPanel.add(rightPanel);
  mainPanel.getElement().setId("mainpanel");
  RootPanel.get("ui").add(mainPanel);
  setWidget(1);
  invalidateBarcode();
}
 

Example 47

From project zxing-iphone, under directory /zxing.appspot.com/generator/src/com/google/zxing/web/generator/client/.

Source file: Generator.java

  19 
vote

public void onModuleLoad(){
  loadGenerators();
  HorizontalPanel mainPanel=new HorizontalPanel();
  setupLeftPanel();
  topPanel.getElement().setId("leftpanel");
  Widget leftPanel=topPanel;
  mainPanel.add(leftPanel);
  SimplePanel div=new SimplePanel();
  SimplePanel div2=new SimplePanel();
  div2.add(result);
  div2.getElement().setId("innerresult");
  div.add(div2);
  div.getElement().setId("imageresult");
  urlResult.getElement().setId("urlresult");
  downloadText.getElement().setId("downloadText");
  rightPanel.add(div);
  rightPanel.add(downloadText);
  rightPanel.add(urlResult);
  mainPanel.add(rightPanel);
  mainPanel.getElement().setId("mainpanel");
  RootPanel.get("ui").add(mainPanel);
  setWidget(1);
  invalidateBarcode();
}