示例#1
0
 /**
  * Set the browser title, postfixed with the app name.
  *
  * @param pTitleText text to set, <code>null</code> sets no special title
  */
 public static void setBrowserTitle(final String pTitleText) {
   String msg = CbConstants.APPNAME;
   if (pTitleText != null) {
     msg = pTitleText + " - " + msg; // $NON-NLS-1$
   }
   Window.setTitle(msg);
 }
示例#2
0
  @Test
  public void title() {
    // Arrange
    Document.get().setTitle("arranged title");

    // Act
    Window.setTitle("my title");

    // Assert
    assertEquals("my title", Window.getTitle());
    assertEquals("my title", Document.get().getTitle());
  }
示例#3
0
 public void onModuleLoad() {
   setupFileUpload();
   title2 = new HTML(applicationTitle2);
   Window.setTitle(applicationTitle2);
   //		title2.setStylePrimaryName("title");
   //		vp.add(title2);
   //		vp.setCellHorizontalAlignment(title2, HasHorizontalAlignment.ALIGN_CENTER);
   //		//setupDialogBox();
   //		dea.getStates(new AsyncCallback<List<States>>()
   //		  		{
   //		  			public void onFailure(Throwable caught)
   //					 	{
   //
   //					 	}
   //
   //					 	public void onSuccess(List<States> result)
   //						{
   //
   //					 		if(result.size()== 0)
   //					 		{
   //					 			StatesLoader();
   //					 			DistrictsLoader();
   //					 			LocalBodyLoader();
   //					 		}
   //
   //						}
   //		  		});
   //
   //	    layerLoader();
   //		setupLatLongPanel();
   //		setupKeywordPanel();
   //		setupSpatialPanel();
   //		setupAttributePanel();
   //		setupQueryPanels();
   //		setupToolsPanel();
   //		setupLayerManager();
   //		setupTablePanel();
   //		hp.add(vp1);
   //
   //		setupMap();
   //		//creating vertical panel for Map
   //		hp.add(mapWrapper);
   //		setupToolsPanel();
   //		hp.add(vp2);
   //	    vp.add(hp);
   //	    /**vp.add(mapWrapper);
   //	    vp.setCellHorizontalAlignment(mapWrapper, HasHorizontalAlignment.ALIGN_CENTER);*/
   //	    // style the vp
   //	    vp.setWidth("100%");
   //	    vp.setStylePrimaryName("vp");
   // Create the popup dialog box
   RootPanel.get().add(uiObject);
 }
 public MethodCallSearch() {
   initWidget(uiBinder.createAndBindUi(this));
   Window.setTitle("Method call search");
   flowBeginDate.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd/MM/yy")));
   flowBeginDate.getTextBox().setVisibleLength(8);
   flowBeginDate.getTextBox().setMaxLength(8);
   flowBeginDate
       .getTextBox()
       .addKeyPressHandler(
           new KeyPressHandler() {
             public void onKeyPress(KeyPressEvent pEvent) {
               presenter.filterData(MethodCallSearch.this, pEvent);
             }
           });
   tableModel = new MetodCallSearchTableModel(service);
   table = tableModel.getTable();
   searchResult.add(table);
 }
示例#5
0
 public FlowSearch() {
   initWidget(sUiBinder.createAndBindUi(this));
   // TODO Replace this hack with a changeTitleEvent
   Window.setTitle("Flow search");
   beginDate.setFormat(new DateBox.DefaultFormat(DateTimeFormat.getFormat("dd/MM/yy")));
   beginDate.getTextBox().setVisibleLength(8);
   beginDate.getTextBox().setMaxLength(8);
   beginDate
       .getTextBox()
       .addKeyPressHandler(
           new KeyPressHandler() {
             public void onKeyPress(KeyPressEvent pEvent) {
               presenter.filterData(FlowSearch.this, pEvent);
             }
           });
   table = new FlowSearchTableModel(service).getTable();
   searchResult.add(table);
 }
示例#6
0
  private void setWindowTitle(List<String> historyTokens) {
    String tokenI18N = "";
    boolean resolved = false;
    List<String> tokens = historyTokens;

    while (!resolved && tokens.size() > 0) {
      String token = StringUtils.join(tokens, "_");
      tokenI18N = messages.title(token).toUpperCase();

      if (tokenI18N.isEmpty()) {
        tokens = HistoryUtils.removeLast(tokens);
      } else {
        resolved = true;
      }
    }

    if (!resolved) {
      String lastToken = historyTokens.get(historyTokens.size() - 1);

      // TODO generalize suffix approach
      if (lastToken.endsWith(".html")) {
        lastToken = lastToken.substring(0, lastToken.length() - ".html".length());
      }

      // transform camel case to spaces
      lastToken = lastToken.replaceAll("([A-Z])", " $1");

      // upper-case
      lastToken = lastToken.toUpperCase();

      tokenI18N = lastToken;
    }

    // title.setText(tokenI18N);
    Window.setTitle(messages.windowTitle(tokenI18N));
  }