Ejemplo n.º 1
0
  private void updateCalendarEventPopup(boolean newEvent) {
    if (scheduleEventPopup == null) {
      createCalendarEventPopup();
    }

    if (newEvent) {
      scheduleEventPopup.setCaption("New event");
    } else {
      scheduleEventPopup.setCaption("Edit event");
    }

    deleteEventButton.setVisible(!newEvent);
    deleteEventButton.setEnabled(!calendarComponent.isReadOnly());
    applyEventButton.setEnabled(!calendarComponent.isReadOnly());
  }
Ejemplo n.º 2
0
 public void setComponentValue(final String name, final Object object) {
   super.setComponentValue(name, object);
   if (name.equals("title")) {
     dialog.setCaption((String) object);
   }
   if ("icon".equals(name)) {
     dialog.setIcon(getResource(object));
   }
   if ("h".equals(name)) {
     dialog.setHeight("" + object + "px");
   }
   if ("w".equals(name)) {
     dialog.setWidth("" + object + "px");
   }
   if ("x".equals(name)) {
     dialog.setPositionX((Integer) object);
   }
   if ("y".equals(name)) {
     dialog.setPositionY((Integer) object);
   }
   if ("closable".equals(name)) {
     dialog.setClosable((Boolean) object);
   }
   if ("resizable".equals(name)) {
     dialog.setResizable((Boolean) object);
   }
 }
Ejemplo n.º 3
0
 @Override
 public void init() {
   setTheme("mocha");
   Window window = new Window();
   window.setCaption(applicationTitle());
   window.setSizeFull();
   window.addStyleName("mocha-window");
   setMainWindow(window);
   boolean needLogin = true;
   // check user
   if (getUser() != null) {
     needLogin = false;
   } else {
     if (isDevelopMode()) {
       setUser(loadTestUser());
       needLogin = false;
     }
   }
   if (!needLogin) {
     AbstractMainPage homepage = SpringContextUtils.getBean("homepage", AbstractMainPage.class);
     homepage.setResponse(response);
     window.setContent(homepage);
   } else {
     LoginScreen loginScreen = new LoginScreen(cookieUsername);
     loginScreen.setResponse(response);
     window.setContent(loginScreen);
   }
 }
Ejemplo n.º 4
0
  public Window getWindow() {
    if (!isFloatingWindow) {
      return null;
    }

    if (keyboardWindow == null) {
      keyboardWindow = new Window();
      keyboardWindow.setCaption("Virtual Keyboard");
      // keyboardWindow.setPositionX(200);
      // keyboardWindow.setPositionY(100);
      // keyboardWindow.setWidth("600");
      // keyboardWindow.setHeight("300");
      keyboardWindow.setVisible(false);
      keyboardWindow.setContent(this);
      keyboardWindow.setResizable(false);
    }
    return keyboardWindow;
  }
Ejemplo n.º 5
0
  /**
   * @param caption
   * @param primaryStyleName - the style defined styleName
   * @param styleName - the user defined styleName
   * @return
   */
  private void createWindowWith(String caption, String primaryStyleName, String styleName) {

    Window window = new Window();
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    window.setContent(layout);
    layout.addComponent(new Label("Some content"));

    if (caption != null) {
      window.setCaption(caption);
    }

    if (primaryStyleName != null) {
      window.addStyleName(primaryStyleName);
    }

    if (styleName != null) {
      window.addStyleName(styleName);
    }

    parent.getUI().addWindow(window);
  }
Ejemplo n.º 6
0
  private void cargarWindowRegistroPolicia() {
    pnlMantenPolicia = new PanelMantenPolicia(new ArrayList<Opcion>(), "400px");
    pnlMantenPolicia.setParent(this.getParent());

    Window window =
        new Window() {

          private static final long serialVersionUID = 1L;

          protected void close() {
            getApplication().getMainWindow().removeWindow(getWindow());
          }
        };

    window.setCaption("Registrar Policia");
    window.addComponent(pnlMantenPolicia);
    window.setModal(true);
    window.setResizable(false);
    window.setWidth("1000px");
    window.setHeight("-1px");
    getWindow().addWindow(window);
  }
Ejemplo n.º 7
0
 private void setWindowCaption(String string) {
   htmlWindow.setCaption(string);
   textWindow.setCaption(string);
 }