@AutoGenerated
  private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("400px");
    mainLayout.setHeight("300px");

    // top-level component properties
    setWidth("400px");
    setHeight("300px");

    // btn_editar
    btn_editar = new Button();
    btn_editar.setCaption("Editar");
    btn_editar.setImmediate(true);
    btn_editar.setWidth("280px");
    btn_editar.setHeight("-1px");
    mainLayout.addComponent(btn_editar, "top:234.0px;left:60.0px;");

    // tableMaterias
    tableMaterias = new Table();
    tableMaterias.setImmediate(false);
    tableMaterias.setWidth("100.0%");
    tableMaterias.setHeight("200px");
    mainLayout.addComponent(tableMaterias, "top:20.0px;right:60.0px;left:60.0px;");

    return mainLayout;
  }
  @AutoGenerated
  private VerticalLayout buildVerticalLayout_2() {
    // common part: create layout
    verticalLayout_2 = new VerticalLayout();
    verticalLayout_2.setImmediate(false);
    verticalLayout_2.setWidth("-1px");
    verticalLayout_2.setHeight("-1px");
    verticalLayout_2.setMargin(false);

    // label_1
    label_1 = new Label();
    label_1.setStyleName("h1");
    label_1.setImmediate(false);
    label_1.setWidth("-1px");
    label_1.setHeight("-1px");
    label_1.setValue("Filtro de Busqueda de Usuarios");
    verticalLayout_2.addComponent(label_1);

    // horizontalLayout_3
    horizontalLayout_3 = buildHorizontalLayout_3();
    verticalLayout_2.addComponent(horizontalLayout_3);

    // tblUsuarios
    tblUsuarios = new Table();
    tblUsuarios.setImmediate(false);
    tblUsuarios.setWidth("650px");
    tblUsuarios.setHeight("430px");
    verticalLayout_2.addComponent(tblUsuarios);

    return verticalLayout_2;
  }
  private Table getHouseholdFactBaseCubeTable() throws SQLException {
    Table householdFactBaseCubeTable = new Table();
    householdFactBaseCubeTable.setSizeFull();
    householdFactBaseCubeTable.setImmediate(true);
    householdFactBaseCubeTable.setColumnCollapsingAllowed(true);

    householdFactBaseCubeTable.addContainerProperty("ACCOUNT CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("BRANCH CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("FISCAL QUARTER", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("STATUS REASON", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRIMARY BALANCE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("TRANSACTION COUNT", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("ACCOUNT COUNT", String.class, null);

    DecimalFormat formatDecimal = new DecimalFormat("#.##");

    ResultSet resultSet = bankService.viewHouseholdBaseCube();
    int i = 1;
    while (resultSet.next()) {
      householdFactBaseCubeTable.addItem(
          new Object[] {
            resultSet.getObject(1).toString(),
            resultSet.getObject(2).toString(),
            resultSet.getObject(3).toString(),
            resultSet.getObject(4).toString(),
            formatDecimal.format((Double) resultSet.getObject(5)).toString(),
            resultSet.getObject(6).toString().replace(".0", ""),
            resultSet.getObject(7).toString().replace(".0", "")
          },
          new Integer(i));
      i++;
    }

    return householdFactBaseCubeTable;
  }
 private void AddressList() {
   contactList.setContainerDataSource(addressBookData);
   contactList.setVisibleColumns(visibleCols);
   contactList.setSelectable(true);
   contactList.setImmediate(true);
   contactList.setWidth("380px");
   contactList.setHeight("190px");
 }
  @SuppressWarnings("serial")
  private Component getTable() {
    List<UserOprYayasan> lm = GenericPersistence.findList(UserOprYayasan.class);

    dashboardPanels = new VerticalLayout();
    dashboardPanels.addStyleName("dashboard-panels");
    Responsive.makeResponsive(dashboardPanels);
    beans.setBeanIdProperty("id");
    beans.removeAllItems();
    if (lm != null) {
      beans.addAll(lm);
    } else {
      beans.addBean(new UserOprYayasan());
    }

    tabel.addGeneratedColumn(
        "aksi",
        new ColumnGenerator() {
          @Override
          public Object generateCell(Table source, Object itemId, Object columnId) {
            HorizontalLayout hl = new HorizontalLayout();
            Button edit = new Button(FontAwesome.EDIT);
            Button hapus = new Button(FontAwesome.TRASH_O);
            edit.addStyleName(ValoTheme.BUTTON_FRIENDLY);
            edit.addStyleName(ValoTheme.BUTTON_SMALL);
            hapus.addStyleName(ValoTheme.BUTTON_FRIENDLY);
            hapus.addStyleName(ValoTheme.BUTTON_SMALL);
            BeanItem<?> i = (BeanItem<?>) source.getContainerDataSource().getItem(itemId);
            final UserOprYayasan o = (UserOprYayasan) i.getBean();
            edit.addClickListener(
                new ClickListener() {
                  @Override
                  public void buttonClick(ClickEvent event) {
                    tambahUserYayasanbaru(o);
                  }
                });
            hl.addComponent(edit);
            hl.addComponent(hapus);
            return hl;
          }
        });
    tabel.setSizeFull();
    tabel.setImmediate(true);
    tabel.setSelectable(true);
    tabel.setContainerDataSource(beans);
    tabel.setRowHeaderMode(Table.RowHeaderMode.INDEX);
    tabel.setColumnHeader("useNnama", "NAMA PENGGUNA");
    tabel.setColumnHeader("nama", "NAMA");
    tabel.setColumnHeader("realName", "NAMA LENGKAP");
    tabel.setColumnHeader("registerDate", "TANGGAL REGISTRASI");
    tabel.setColumnHeader("email", "E-MAIL");
    tabel.setColumnHeader("lastSuccessfulLogin", "TERAKHIR LOGIN");
    tabel.setColumnHeader("aksi", "AKSI");
    tabel.setVisibleColumns(
        "aksi", "nama", "realName", "registerDate", "email", "lastSuccessfulLogin");
    dashboardPanels.addComponent(tabel);
    return dashboardPanels;
  }
  /**
   * Build content 'evaluation process' of tab 3.
   *
   * @return content of third tab
   */
  private Layout buildTab3Content() {
    VerticalLayout tab3Content = new VerticalLayout();
    tab3Content.setSpacing(true);
    tab3Content.setMargin(true);
    tab3Content.setSizeFull();

    Label instructions =
        new Label(
            "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>",
            Label.CONTENT_XHTML);
    tab3Content.addComponent(instructions);

    this.tableEvaluation = new Table("Evaluation process:");
    tableEvaluation.setHeight("150px");
    tableEvaluation.setWidth("100%");
    tableEvaluation.setImmediate(true);
    tableEvaluation.setSelectable(true);
    tableEvaluation.setMultiSelect(false);
    tableEvaluation.setSortDisabled(false);
    tableEvaluation.addContainerProperty("ID", Integer.class, null);
    tableEvaluation.addContainerProperty("Sentence", String.class, null);
    tableEvaluation.addContainerProperty("Precision", Double.class, null);
    tableEvaluation.addContainerProperty("Recall", Double.class, null);
    tableEvaluation.addContainerProperty("F-Score", Double.class, null);
    tab3Content.addComponent(tableEvaluation);

    this.buttonNext2 = new Button("Next");
    buttonNext2.setImmediate(true);
    buttonNext2.setDescription("Get the next sentence in table");
    tab3Content.addComponent(buttonNext2);

    this.textAreaEvalSentence = new TextArea("Sentence:");
    textAreaEvalSentence.setImmediate(false);
    textAreaEvalSentence.setReadOnly(true);
    textAreaEvalSentence.setRows(3);
    textAreaEvalSentence.setWidth("100%");
    tab3Content.addComponent(textAreaEvalSentence);

    HorizontalLayout hlay1 = new HorizontalLayout();
    this.listSelectGoldstandard = new ListSelect("Goldstandard:");
    listSelectGoldstandard.setImmediate(true);
    listSelectGoldstandard.setHeight("120px");
    listSelectGoldstandard.setWidth("100%");
    listSelectGoldstandard.setNullSelectionAllowed(false);
    this.listSelectFramework = new ListSelect("Framework:");
    listSelectFramework.setImmediate(true);
    listSelectFramework.setHeight("120px");
    listSelectFramework.setWidth("100%");
    listSelectFramework.setNullSelectionAllowed(false);
    hlay1.setSpacing(true);
    hlay1.setMargin(false);
    hlay1.setWidth("100%");
    hlay1.addComponent(listSelectGoldstandard);
    hlay1.addComponent(listSelectFramework);
    tab3Content.addComponent(hlay1);

    return tab3Content;
  }
Beispiel #7
0
  private Table createTable(String caption) {
    Table table = new Table(caption);
    table.setImmediate(true);

    table.addContainerProperty("column1", String.class, "test");
    table.setSizeFull();
    table.setHeight("500px");
    table.setSelectable(true);

    return table;
  }
 @Override
 public void bind() {
   Table userList = this.view.getUserList();
   container = new BeanItemContainer<User>(User.class);
   userList.setContainerDataSource(container);
   userList.setVisibleColumns(new String[] {"userName", "firstName", "lastName"});
   userList.setImmediate(true);
   userList.setSelectable(true);
   userList.setMultiSelect(false);
   // userList.setEditable(true);
 }
  protected Table createList() {
    groupTable = new Table();

    groupTable.setEditable(false);
    groupTable.setImmediate(true);
    groupTable.setSelectable(true);
    groupTable.setNullSelectionAllowed(false);
    groupTable.setSortDisabled(true);
    groupTable.setSizeFull();

    groupListQuery = new GroupListQuery();
    groupListContainer = new LazyLoadingContainer(groupListQuery, 20);
    groupTable.setContainerDataSource(groupListContainer);

    // Column headers
    groupTable.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.GROUP_22));
    groupTable.setColumnWidth("icon", 22);
    groupTable.addContainerProperty("name", String.class, null);
    groupTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);

    // Listener to change right panel when clicked on a user
    groupTable.addListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          public void valueChange(ValueChangeEvent event) {
            Item item =
                groupTable.getItem(
                    event
                        .getProperty()
                        .getValue()); // the value of the property is the itemId of the table entry
            if (item != null) {
              String groupId = (String) item.getItemProperty("id").getValue();
              setDetailComponent(new GroupDetailPanel(GroupPage.this, groupId));

              // Update URL
              ExplorerApp.get()
                  .setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
            } else {
              // Nothing is selected
              setDetailComponent(null);
              ExplorerApp.get()
                  .setCurrentUriFragment(new UriFragment(GroupNavigator.GROUP_URI_PART, groupId));
            }
          }
        });

    return groupTable;
  }
Beispiel #10
0
  @SuppressWarnings("deprecation")
  private Table getFractionTable(Map<Integer, ProteinBean> proteinFractionAvgList) {
    Table table = new Table();
    table.setStyleName(Reindeer.TABLE_STRONG + " " + Reindeer.TABLE_BORDERLESS);
    table.setHeight("150px");
    table.setWidth("100%");
    table.setSelectable(true);
    table.setColumnReorderingAllowed(true);
    table.setColumnCollapsingAllowed(true);
    table.setImmediate(true); // react at once when something is selected
    table.addContainerProperty(
        "Fraction Index",
        Integer.class,
        null,
        "Fraction Index",
        null,
        com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "# Peptides ", Integer.class, null, "# Peptides ", null, com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "# Spectra ", Integer.class, null, "# Spectra", null, com.vaadin.ui.Table.ALIGN_CENTER);
    table.addContainerProperty(
        "Average Precursor Intensity",
        Double.class,
        null,
        "Average Precursor Intensity",
        null,
        com.vaadin.ui.Table.ALIGN_CENTER);
    /* Add a few items in the table. */
    int x = 0;
    for (int index : proteinFractionAvgList.keySet()) {
      ProteinBean pb = proteinFractionAvgList.get(index);
      table.addItem(
          new Object[] {
            new Integer(index),
            pb.getNumberOfPeptidePerFraction(),
            pb.getNumberOfSpectraPerFraction(),
            pb.getAveragePrecursorIntensityPerFraction()
          },
          new Integer(x + 1));
      x++;
    }
    for (Object propertyId : table.getSortableContainerPropertyIds()) {
      table.setColumnExpandRatio(propertyId.toString(), 1.0f);
    }

    return table;
  }
  @AutoGenerated
  private AbsoluteLayout buildAbsLTabla() {
    // common part: create layout
    absLTabla = new AbsoluteLayout();
    absLTabla.setImmediate(false);
    absLTabla.setWidth("100.0%");
    absLTabla.setHeight("265px");

    // tblAvance
    tblAvance = new Table();
    tblAvance.setCaption("* Dar doble click sobre un elemento para modificarlo");
    tblAvance.setImmediate(false);
    tblAvance.setWidth("425px");
    tblAvance.setHeight("225px");
    absLTabla.addComponent(tblAvance, "top:28.0px;left:10.0px;");

    return absLTabla;
  }
  private Table fillTable(String[] headerTable, List reportData) {
    Table table = new Table();
    // header
    for (int i = 0; i < headerTable.length; i++) {
      table.addContainerProperty(headerTable[i], String.class, null);
    }
    // body
    ListIterator iterator = reportData.listIterator();
    for (int i = 0; iterator.hasNext(); i++) {
      table.addItem((Object[]) iterator.next(), i);
    }

    table.setPageLength(table.size());
    table.setSelectable(false);
    table.setNullSelectionAllowed(false);
    table.setImmediate(true);

    return table;
  }
  @AutoGenerated
  private VerticalLayout buildVerticalLayout_1() {
    // common part: create layout
    verticalLayout_1 = new VerticalLayout();
    verticalLayout_1.setImmediate(false);
    verticalLayout_1.setWidth("100.0%");
    verticalLayout_1.setHeight("100.0%");
    verticalLayout_1.setMargin(false);

    // gameResultTable
    gameResultTable = new Table();
    gameResultTable.setImmediate(false);
    gameResultTable.setWidth("100.0%");
    gameResultTable.setHeight("100.0%");
    verticalLayout_1.addComponent(gameResultTable);
    verticalLayout_1.setExpandRatio(gameResultTable, 1.0f);

    return verticalLayout_1;
  }
  /**
   * The constructor should first build the main layout, set the composition root and then do any
   * custom initialization.
   *
   * <p>The constructor will not be automatically regenerated by the visual editor.
   */
  public PanelListaMateriasParaEditar(final BloqueBO bloqueBO) {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    this.bloqueBO = bloqueBO;

    btn_editar.setEnabled(false);

    tableMaterias.addContainerProperty("Materias", MateriaBO.class, null);
    tableMaterias.setSelectable(true);
    tableMaterias.setImmediate(true);

    tableMaterias.addValueChangeListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            btn_editar.setEnabled(tableMaterias.getValue() != null);
          }
        });

    btn_editar.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            try {
              int i = Integer.parseInt(tableMaterias.getValue().toString());
              ControladorAdministrador.getInstance().getAcademUI().cerrarVentanaEmergente();
              ControladorAdministrador.getInstance()
                  .mostrarPanelEditarMateria(listMaterias.get(i), bloqueBO);
            } catch (Exception e) {

            }
          }
        });
  }
  @AutoGenerated
  private VerticalLayout buildPnlPrincipal() {
    // common part: create layout
    pnlPrincipal = new VerticalLayout();
    pnlPrincipal.setImmediate(false);
    pnlPrincipal.setWidth("-1px");
    pnlPrincipal.setHeight("-1px");
    pnlPrincipal.setMargin(false);
    pnlPrincipal.setSpacing(true);

    // lytFormulario1
    lytFormulario1 = buildLytFormulario1();
    pnlPrincipal.addComponent(lytFormulario1);

    // lytFormulario2
    lytFormulario2 = buildLytFormulario2();
    pnlPrincipal.addComponent(lytFormulario2);

    // lytFormulario3
    lytFormulario3 = buildLytFormulario3();
    pnlPrincipal.addComponent(lytFormulario3);

    // btnGuardar
    btnGuardar = new Button();
    btnGuardar.setCaption("Agregar");
    btnGuardar.setImmediate(true);
    btnGuardar.setWidth("-1px");
    btnGuardar.setHeight("-1px");
    pnlPrincipal.addComponent(btnGuardar);
    pnlPrincipal.setComponentAlignment(btnGuardar, new Alignment(20));

    // tblNotificacion
    tblNotificacion = new Table();
    tblNotificacion.setImmediate(false);
    tblNotificacion.setWidth("940px");
    tblNotificacion.setHeight("200px");
    pnlPrincipal.addComponent(tblNotificacion);

    return pnlPrincipal;
  }
  @AutoGenerated
  private VerticalLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("-1px");
    mainLayout.setHeight("-1px");
    mainLayout.setMargin(true);
    mainLayout.setSpacing(true);

    // top-level component properties
    setWidth("-1px");
    setHeight("-1px");

    // horizontalLayout_1
    horizontalLayout_1 = buildHorizontalLayout_1();
    mainLayout.addComponent(horizontalLayout_1);

    // tableFunction
    tableFunction = new Table();
    tableFunction.setCaption("Select A Function");
    tableFunction.setImmediate(false);
    tableFunction.setWidth("100.0%");
    tableFunction.setHeight("-1px");
    tableFunction.setInvalidAllowed(false);
    tableFunction.setRequired(true);
    mainLayout.addComponent(tableFunction);
    mainLayout.setExpandRatio(tableFunction, 1.0f);

    // buttonSelect
    buttonSelect = new Button();
    buttonSelect.setCaption("Select and Continue");
    buttonSelect.setImmediate(true);
    buttonSelect.setWidth("-1px");
    buttonSelect.setHeight("-1px");
    mainLayout.addComponent(buttonSelect);
    mainLayout.setComponentAlignment(buttonSelect, new Alignment(48));

    return mainLayout;
  }
  protected Table createList() {
    // customerService =  ProcessEngines.getDefaultProcessEngine().getCustomerService();
    // customerService.newUser("hebele");
    Table table = new Table();

    table.addStyleName(ExplorerLayout.STYLE_PROCESS_DEFINITION_LIST);
    // table.addGeneratedColumn("icon", new ThemeImageColumnGenerator(Images.REPORT_22));
    table.setColumnWidth("icon", 18);

    // table.addContainerProperty("name", String.class, null);
    table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);

    // Set non-editable, selectable and full-size
    table.setEditable(false);
    table.setImmediate(true);
    table.setSelectable(true);
    table.setNullSelectionAllowed(false);
    table.setSortDisabled(true);
    table.setSizeFull();

    return table;
  }
  private void initContactList() {
    contactList.setContainerDataSource(contactContainer);
    contactList.setVisibleColumns(new String[] {FNAME, LNAME, COMPANY});
    contactList.setSelectable(true);
    contactList.setImmediate(true);

    contactList.addValueChangeListener(
        new Property.ValueChangeListener() {
          public void valueChange(ValueChangeEvent event) {
            Object contactId = contactList.getValue();

            /*
             * When a contact is selected from the list, we want to show
             * that in our editor on the right. This is nicely done by the
             * FieldGroup that binds all the fields to the corresponding
             * Properties in our contact at once.
             */
            if (contactId != null) editorFields.setItemDataSource(contactList.getItem(contactId));

            editorLayout.setVisible(contactId != null);
          }
        });
  }
  private Table getHouseholdFactBaseCubeTable() throws SQLException {
    Table householdFactBaseCubeTable = new Table();
    householdFactBaseCubeTable.setSizeFull();
    householdFactBaseCubeTable.setImmediate(true);
    householdFactBaseCubeTable.setColumnCollapsingAllowed(true);

    householdFactBaseCubeTable.addContainerProperty("ACCOUNT CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("HOUSEHOLD STATE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRODUCT TYPE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("BRANCH CITY", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("PRIMARY BALANCE", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("TRANSACTION COUNT", String.class, null);
    householdFactBaseCubeTable.addContainerProperty("ACCOUNT COUNT", String.class, null);

    DecimalFormat formatDecimal = new DecimalFormat("#.##");

    ResultSet resultSet =
        bankService.viewHouseholdBaseCubeFourDims(
            "a.account_city", "h.household_state", "p.type", "b.branch_city");
    int i = 1;
    while (resultSet.next()) {
      householdFactBaseCubeTable.addItem(
          new Object[] {
            resultSet.getObject(1).toString(),
            resultSet.getObject(2).toString(),
            resultSet.getObject(3).toString(),
            resultSet.getObject(4).toString(),
            formatDecimal.format((Double) resultSet.getObject(5)).toString(),
            resultSet.getObject(6).toString().replace(".0", ""),
            resultSet.getObject(7).toString().replace(".0", "")
          },
          new Integer(i));
      i++;
    }

    return householdFactBaseCubeTable;
  }
  public AttachedDocumentsSubWindow(
      Window subWindow,
      BeanItem<AttachedDocumentObject> beanItem,
      boolean readonly,
      boolean isNewAttach,
      WebApplicationContext context) {
    this.context = context;
    this.subWindow = subWindow;
    this.beanItem = beanItem;
    this.readonly = readonly;

    setCaption(FactoryI18nManager.getI18nManager().getMessage(Messages.COMMON_ABM_TAB_DOCUMENTS));
    setModal(true);
    setHeight("68%");
    setWidth("40%");
    center();
    setStyleName("pagingButtonBar");

    documentsForm = new AttachedDocumentsForm();
    documentsForm.setFormFieldFactory(new AttachedDocumentsFormFieldFactory());

    fileTable = new Table();
    fileTable.setWidth("500");
    fileTable.setHeight("180");
    fileTable.setSelectable(true);
    fileTable.setImmediate(true);
    fileTable.addContainerProperty(
        FactoryI18nManager.getI18nManager()
            .getMessage(Messages.ATTACHED_DOCUMENT_OBJECT_FILE_TABLE_HEADER_NAME),
        String.class,
        null);
    fileTable.addContainerProperty(
        FactoryI18nManager.getI18nManager()
            .getMessage(Messages.ATTACHED_DOCUMENT_OBJECT_FILE_TABLE_HEADER_SIZE),
        String.class,
        null);
    fileTable.addListener((ValueChangeListener) this);

    footerTable = new HorizontalLayout();
    footerTable.setVisible(true);
    setIconsAndDescriptionButton();

    footerTable.addComponent(buttonNew);
    footerTable.addComponent(buttonDelete);
    footerTable.addComponent(buttonModify);
    footerTable.addComponent(buttonDownload);
    footerTable.addComponent(buttonLookUp);

    verticalLayout.setMargin(true);
    verticalLayout.addComponent(documentsForm);
    verticalLayout.addComponent(new Label("Archivos:"));
    verticalLayout.addComponent(fileTable);
    verticalLayout.addComponent(footerTable);

    horizontalLayout.addComponent(buttonAdd);
    horizontalLayout.setComponentAlignment(buttonAdd, Alignment.BOTTOM_CENTER);
    horizontalLayout.addComponent(buttonCancel);
    horizontalLayout.setComponentAlignment(buttonCancel, Alignment.BOTTOM_CENTER);

    verticalLayout.addComponent(horizontalLayout);
    verticalLayout.setComponentAlignment(horizontalLayout, Alignment.BOTTOM_CENTER);

    setContent(verticalLayout);

    initializeForm();
    initializeTable();

    setComponentsState(isNewAttach);

    setClosable(readonly);
  }
Beispiel #21
0
  protected Component createMainArea() {
    layout = new VerticalLayout();

    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setSizeFull();

    HorizontalLayout filterLine = new HorizontalLayout();

    TextField filterBox = new TextField();
    filterBox.addStyleName(JabylonStyle.SEARCH_FIELD.getCSSName());
    filterBox.addListener(
        new TextChangeListener() {

          @Override
          public void textChange(TextChangeEvent event) {
            propertyFilter.setFilterText(event.getText());
            propertyPairContainer.addContainerFilter(propertyFilter);
          }
        });
    filterBox.setInputPrompt(
        Messages.getString("PropertiesEditor_FILTER_INPUT_PROMPT")); // $NON-NLS-1$
    filterLine.addComponent(filterBox);

    final CheckBox untranslatedBox =
        new CheckBox(
            Messages.getString(
                "PropertiesEditor_SHOW_ONLY_UNTRANSLATED_BUTTON_CAPTION")); //$NON-NLS-1$
    untranslatedBox.addListener(
        new ClickListener() {

          @Override
          public void buttonClick(ClickEvent event) {
            propertyPairContainer.removeContainerFilter(untranslatedFilter);
            if (untranslatedBox.getValue().equals(Boolean.TRUE))
              propertyPairContainer.addContainerFilter(untranslatedFilter);
          }
        });
    untranslatedBox.setImmediate(true);
    filterLine.addComponent(untranslatedBox);

    layout.addComponent(filterLine);
    layout.setExpandRatio(filterLine, 0);

    table = new Table();
    table.addStyleName(JabylonStyle.TABLE_STRIPED.getCSSName());
    table.setSizeFull();
    target = descriptor.loadProperties();
    source = descriptor.getMaster().loadProperties();

    propertyPairContainer = new PropertyPairContainer(source, target);
    table.setContainerDataSource(propertyPairContainer);
    table.setVisibleColumns(
        propertyPairContainer.getContainerPropertyIds().subList(0, 2).toArray());
    table.setWidth(100, Table.UNITS_PERCENTAGE);
    table.addGeneratedColumn(
        Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER"),
        new ColumnGenerator() { //$NON-NLS-1$

          @Override
          public Object generateCell(Table source, Object itemId, Object columnId) {

            if (reviews.containsKey(itemId)) {
              Embedded embedded = new Embedded("", ImageConstants.IMAGE_ERROR); // $NON-NLS-1$

              Review review = reviews.get((String) itemId).iterator().next();
              // TODO: this can't be the right way to refresh?
              if (review.cdoInvalid()) {
                reviews.remove(itemId, review); // the review is
                // no
                // longer valid
                embedded.setIcon(ImageConstants.IMAGE_OK);
                embedded.setDescription(""); // $NON-NLS-1$
              } else {
                embedded.setDescription(review.getMessage());
              }

              return embedded;
            } else return new Embedded("", ImageConstants.IMAGE_OK); // $NON-NLS-1$
          }
        });

    table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT);

    table.setColumnHeaders(
        new String[] {
          Messages.getString("PropertiesEditor_ORIGINAL_COLUMN_HEADER"),
          Messages.getString("PropertiesEditor_TRANSLATED_COLUMN_HEADER"),
          Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER")
        }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    table.setColumnExpandRatio(propertyPairContainer.getContainerPropertyIds().get(0), 1.0f);
    table.setColumnExpandRatio(propertyPairContainer.getContainerPropertyIds().get(1), 1.0f);
    table.setColumnExpandRatio(
        Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER"), 0.0f); // $NON-NLS-1$

    table.setEditable(false);
    table.setWriteThrough(false);

    table.setSelectable(true);
    table.setMultiSelect(false);
    table.setImmediate(true); // react at once when something is selected
    table.addListener(this);

    layout.addComponent(table);

    layout.setExpandRatio(table, 2);
    createEditorArea();
    return layout;
  }
  public void initComponent() {

    tableList =
        new Table() {
          @Override
          protected String formatPropertyValue(Object rowId, Object colId, Property property) {
            // Format by property type
            if (property.getType() == Date.class && property.getValue() != null) {
              SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
              return df.format((Date) property.getValue());
            }

            //		        if (property.getType()==Boolean.class){
            //		        	if ((Boolean) property.getValue()==true) {
            //		        		return "Active";
            //		        	} else {
            //		        		return "-";
            //		        	}
            //		        }

            return super.formatPropertyValue(rowId, colId, property);
          }
        };
    tableDetil =
        new Table() {
          @Override
          protected String formatPropertyValue(Object rowId, Object colId, Property property) {
            // Format by property type
            if (property.getType() == Date.class && property.getValue() != null) {
              SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
              return df.format((Date) property.getValue());
            }

            //		        if (property.getType()==Boolean.class){
            //		        	if ((Boolean) property.getValue()==true) {
            //		        		return "Active";
            //		        	} else {
            //		        		return "-";
            //		        	}
            //		        }

            return super.formatPropertyValue(rowId, colId, property);
          }
        };

    // ::LIST
    fieldSearch1.setWidth("100px");
    fieldSearch2.setWidth("100px");
    fieldSearch2.setWidth("100px");
    comboSearch1.setWidth("200px");
    comboSearch2.setWidth("200px");

    // ::DETIL
    fieldNomor.setNullRepresentation("");
    fieldInvoiceno.setNullRepresentation("");

    fieldNomor.setWidth("100px");
    fieldInvoiceno.setWidth("100px");
    comboTipeopname.setWidth("200px");
    comboTipeopname.setFilteringMode(FilteringMode.CONTAINS);
    comboWarehouse.setWidth("200px");
    comboWarehouse.setFilteringMode(FilteringMode.CONTAINS);

    dateFieldTrdate.setDateFormat("dd/MM/yyyy");
    dateFieldEntrydate.setDateFormat("dd/MM/yyyy");
    dateFieldTrdate.setWidth("100px");
    dateFieldEntrydate.setWidth("100px");

    btnSearch.setIcon(new ThemeResource("../images/navigation/12x12/Find.png"));
    btnNewForm.setIcon(new ThemeResource("../images/navigation/12x12/Create.png"));
    btnEditForm.setIcon(new ThemeResource("../images/navigation/12x12/Pencil.png"));
    btnDeleteForm.setIcon(new ThemeResource("../images/navigation/12x12/Erase.png"));
    //		btnPrint.setIcon(new ThemeResource("../images/navigation/12x12/Print.png"));

    btnSaveForm.setIcon(new ThemeResource("../images/navigation/12x12/Save.png"));
    btnCancelForm.setIcon(new ThemeResource("../images/navigation/12x12/Undo.png"));

    btnAddItem.setIcon(new ThemeResource("../images/navigation/12x12/Create.png"));
    btnEditForm.setIcon(new ThemeResource("../images/navigation/12x12/Pencil.png"));
    btnRemoveItem.setIcon(new ThemeResource("../images/navigation/12x12/Erase.png"));

    btnPosting.setIcon(new ThemeResource("../images/navigation/12x12/OK.png"));
    //		btnPostingBatal.setIcon(new ThemeResource("../images/navigation/12x12/OK.png"));
    btnLapselisih.setIcon(new ThemeResource("../images/navigation/12x12/Print.png"));

    tableList.setSelectable(true);
    tableList.setImmediate(true);
    tableList.setBuffered(false);
    tableList.setFooterVisible(true);

    tableDetil.setSelectable(true);
    tableDetil.setImmediate(true);
    tableDetil.setBuffered(false);
    tableDetil.setFooterVisible(true);

    // VALIDATOR
    fieldNomor.setRequired(true);
    comboTipeopname.setRequired(true);
    comboWarehouse.setRequired(true);
    dateFieldTrdate.setRequired(true);
    //		fieldDescription.setRequired(true);

    btnSeparator1.setEnabled(false);
    btnSeparator2.setEnabled(false);

    // FIELD FOOTER
    fieldDisc1 = new TextField();
    fieldDisc1rp = new TextField();
    fieldDisc1rpafterppn = new TextField();
    fieldDisc1.setWidth("50px");
    fieldDisc1rp.setWidth("50px");
    fieldDisc1rpafterppn.setWidth("150px");
    fieldDisc1rpafterppn.addStyleName("numerical");

    fieldDisc2 = new TextField();
    fieldDisc2rp = new TextField();
    fieldDisc2rpafterppn = new TextField();
    fieldDisc2.setWidth("50px");
    fieldDisc2rp.setWidth("50px");
    fieldDisc2rpafterppn.setWidth("150px");
    fieldDisc2rpafterppn.addStyleName("numerical");

    fieldDisc = new TextField();
    fieldDiscrp = new TextField();
    fieldDiscrpafterppn = new TextField();
    fieldDisc.setWidth("50px");
    fieldDiscrp.setWidth("50px");
    fieldDiscrpafterppn.setWidth("150px");
    fieldDiscrpafterppn.addStyleName("numerical");

    fieldAmount.setWidth("200px");
    fieldAmount.addStyleName("numerical");
    fieldAmountafterdisc.setWidth("200px");
    fieldAmountafterdisc.addStyleName("numerical");
    fieldAmountafterdiscafterppn.setWidth("200px");
    fieldAmountafterdiscafterppn.addStyleName("numerical");
    fieldAmountafterppn.setWidth("200px");
    fieldAmountafterppn.addStyleName("numerical");
    fieldAmountpay.setWidth("200px");
    fieldAmountpay.addStyleName("numerical");
    fieldAmountpayfaterppn.setWidth("200px");
    fieldAmountpayfaterppn.addStyleName("numerical");
    fieldPpnrp.setWidth("200px");
    fieldPpnrp.addStyleName("numerical");

    fieldPpnpercent.setWidth("50px");
  }
  public TradeTab() {
    HorizontalSplitPanel mainPanel = new HorizontalSplitPanel();
    mainPanel.setHeight("100%");

    VerticalLayout leftPanel = new VerticalLayout();
    leftPanel.setMargin(true);
    leftPanel.setSpacing(true);
    leftPanel.setHeight("100%");

    itemContainer.addContainerProperty("auction", AuctionService.class, null);
    itemContainer.addContainerProperty("id", String.class, null);
    itemContainer.addContainerProperty("description", String.class, null);
    itemContainer.addContainerProperty("startingPrice", Long.class, null);
    itemContainer.addContainerProperty("item", AuctionItem.class, null);

    itemTable.addStyleName("h1");
    //		itemTable.addStyleName("noheader");
    itemTable.setSelectable(true);
    itemTable.setImmediate(true);
    itemTable.setVisibleColumns(new String[] {"description", "startingPrice"});
    itemTable.setColumnHeaders(new String[] {"Description", "Starting Price"});
    itemTable.setSizeFull();

    itemTable.addListener(
        new Property.ValueChangeListener() {
          public void valueChange(ValueChangeEvent event) {
            Application application = getApplication();
            if (application instanceof UriFragmentService)
              ((UriFragmentService) application).setUriFragment(getCurrentUriFragment(), false);

            Object itemId = itemTable.getValue();
            AuctionItem item =
                itemId != null
                    ? (AuctionItem) itemTable.getContainerProperty(itemId, "item").getValue()
                    : null;
            for (Iterator<Component> iter = dynamicLayout.getComponentIterator();
                iter.hasNext(); ) {
              Component component = iter.next();
              if (component instanceof SelectionListener<?>) {
                ((SelectionListener<AuctionItem>) component).selectionChanged(item);
              }
            }
          }
        });

    leftPanel.addComponent(itemTable);
    leftPanel.setExpandRatio(itemTable, 1f);

    // Button panel
    VerticalLayout buttonBarLayout = new VerticalLayout();
    buttonBar = new DynamicContainer(buttonBarLayout);
    buttonBar.setWidth("100%");
    leftPanel.addComponent(buttonBar);

    // Progress Indicator (hidden)
    ProgressIndicator progress = new ProgressIndicator(ProgressIndicator.SIZE_UNDEFINED);
    progress.addStyleName("hidden");
    progress.setPollingInterval(POLL_INTERVAL);
    leftPanel.addComponent(progress);
    leftPanel.setExpandRatio(progress, 0f);

    mainPanel.addComponent(leftPanel);
    mainPanel.addComponent(container);

    Table table = new Table();
    table.setSizeFull();

    setCompositionRoot(mainPanel);
    setCaption("Trade");
    setSizeFull();
  }
Beispiel #24
0
  @Override
  public void init() {
    Window mainWindow = new Window("GridDemo");
    mainWindow.getContent().setSizeFull();
    ((VerticalLayout) mainWindow.getContent()).setSpacing(true);
    Indexed c = getTestContainer();
    final Table table = new Table();
    table.setImmediate(true);
    table.setSizeUndefined();
    table.setHeight("100%");
    table.setWidth("100%");
    table.setContainerDataSource(c);
    table.setCacheRate(0.5d);

    table.setNullSelectionAllowed(false);
    final Grid grid = new Grid(c);
    grid.setWidth("100%");
    grid.setHeight("100%");

    mainWindow.addComponent(grid);
    grid.getBody().setCelEditingEnabled(true);
    grid.setColumnWidth("p1", 200);
    grid.setImmediate(true);
    grid.setColumnAlignment("p1", Align.RIGHT);
    grid.setColumnAlignment("p2", Align.CENTER);
    grid.getHeader()
        .setHeaderFactory(
            new HeaderComponentFactory() {
              @Override
              public Component createComponent(final Grid grid, final Object propertyId) {
                final TextField l = new TextField("<b>" + propertyId + "<\b>");
                l.setImmediate(true);
                l.setWidth("100%");
                l.addListener(
                    new ValueChangeListener() {
                      @Override
                      public void valueChange(ValueChangeEvent event) {
                        ((Filterable) grid.getContainerDataSource())
                            .addContainerFilter(
                                new Filter() {

                                  @Override
                                  public boolean passesFilter(Object itemId, Item item)
                                      throws UnsupportedOperationException {
                                    return item.getItemProperty(propertyId)
                                        .getValue()
                                        .toString()
                                        .contains(l.getValue().toString());
                                  }

                                  @Override
                                  public boolean appliesToProperty(Object id) {
                                    return id.equals(propertyId);
                                  }
                                });
                      }
                    });
                return l;
              }
            });
    table.setEditable(true);
    // mainWindow.addComponent(table);
    setMainWindow(mainWindow);
    setTheme("griddemotheme");
  }
  @Override
  public void postConstruct() {

    flagNuevoUsuario = true;
    btnCrearUsuario.setIcon(Constante.ICONOS.SAVE);
    btnEliminarUsuario.setIcon(Constante.ICONOS.DELETE);
    btnAgregarPolicia.setIcon(Constante.ICONOS.CREATE);

    lstRoles = rolService.buscar(null);
    BeanItemContainer<Rol> bicRoles = new BeanItemContainer<Rol>(Rol.class, lstRoles);
    cmbRol.setInputPrompt("Rol");
    cmbRol.setContainerDataSource(bicRoles);
    cmbRol.setItemCaptionPropertyId("nombre");
    cmbRol.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
    cmbRol.setImmediate(true);
    cmbRol.addListener((ValueChangeListener) this);

    lstPolicias = policiaService.buscar(null);
    BeanItemContainer<Policia> bicPolicias =
        new BeanItemContainer<Policia>(Policia.class, lstPolicias);
    cmbPolicia.setInputPrompt("Policia");
    cmbPolicia.setContainerDataSource(bicPolicias);
    cmbPolicia.setItemCaptionPropertyId("nombreCompleto");
    cmbPolicia.setImmediate(true);
    cmbPolicia.addListener(
        new ValueChangeListener() {

          private static final long serialVersionUID = 4418094011985520491L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            pintarPersona(event);
          }

          private void pintarPersona(ValueChangeEvent event) {

            if (cmbPolicia.getValue() != null) {
              Policia policia = (Policia) cmbPolicia.getValue();
              txtApellidoPaterno.setValue(policia.getPersona().getApePaterno());
              txtApellidoMaterno.setValue(policia.getPersona().getApeMaterno());
              txtNombres.setValue(policia.getPersona().getNombres());
              txtCargo.setValue(
                  policia.getCargo() != null ? policia.getCargo().getNombre() : StringUtils.EMPTY);
            }
          }
        });

    cmbPolicia.addListener((ValueChangeListener) this);

    cmbOficina.setItemCaptionPropertyId("nombre");
    cmbOficina.setInputPrompt("Oficina");

    lstDependencias = dependenciasService.buscar(null);
    BeanItemContainer<Dependencia> bicDependencias =
        new BeanItemContainer<Dependencia>(Dependencia.class, lstDependencias);
    cmbOficina.setContainerDataSource(bicDependencias);
    cmbOficina.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
    cmbOficina.setImmediate(true);
    cmbOficina.addListener((ValueChangeListener) this);

    tblUsuarios.setSelectable(true);
    tblUsuarios.setImmediate(true);
    tblUsuarios.setNullSelectionAllowed(true);
    tblUsuarios.setNullSelectionItemId(null);

    habilitarBoton(false);
    btnCrearUsuario.addListener((ClickListener) this);
    btnEliminarUsuario.addListener((ClickListener) this);
    btnAgregarPolicia.addListener((ClickListener) this);

    tblUsuarios.addListener(
        new ValueChangeListener() {
          private static final long serialVersionUID = -6124596484581515359L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            boolean esModoNuevo = tblUsuarios.getValue() == null;
            habilitarBoton(!esModoNuevo);
            limpiar();
            if (esModoNuevo) {
              tblUsuarios.setValue(null);
              habilitarEdicion(esModoNuevo);
            } else {
              Item item = tblUsuarios.getItem(tblUsuarios.getValue());
              clave = item.getItemProperty("clave").getValue().toString();
              txtUsuario.setValue(item.getItemProperty("usuario").getValue());
              txtNombres.setValue(item.getItemProperty("nombres").getValue());
              txtApellidoPaterno.setValue(item.getItemProperty("apePat").getValue());
              txtApellidoMaterno.setValue(item.getItemProperty("apeMat").getValue());
              cmbPolicia.select(item.getItemProperty("policia").getValue());
              cmbOficina.select(item.getItemProperty("dependencia").getValue());
              cmbRol.select(item.getItemProperty("rol").getValue());
              txtCargo.setValue(
                  item.getItemProperty("cargo").getValue() != null
                      ? item.getItemProperty("cargo").getValue()
                      : StringUtils.EMPTY);
              txtCargoDescripcion.setValue(
                  item.getItemProperty("descCargo").getValue() != null
                      ? item.getItemProperty("descCargo").getValue()
                      : StringUtils.EMPTY);
              habilitarEdicion(esModoNuevo);
            }
          }
        });

    txtFiltroUsuario.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });
    txtFiltroNombres.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });
    txtFiltroApePaterno.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });
    txtFiltroApeMaterno.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });
    txtFiltroCargo.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });
    txtFiltroOficina.addShortcutListener(
        new ShortcutListener("", KeyCode.ENTER, null) {
          private static final long serialVersionUID = 4068232062569621771L;

          @Override
          public void handleAction(Object sender, Object target) {
            shortCutEnter(sender, target);
          }
        });

    txtUsuario.setImmediate(true);
    txtNombres.setImmediate(true);
    txtApellidoPaterno.setImmediate(true);
    txtApellidoMaterno.setImmediate(true);
    txtCargo.setImmediate(true);
    txtFiltroOficina.setImmediate(true);

    txtUsuario.addListener((TextChangeListener) this);
    txtNombres.addListener((TextChangeListener) this);
    txtApellidoPaterno.addListener((TextChangeListener) this);
    txtApellidoMaterno.addListener((TextChangeListener) this);
    txtCargo.addListener((TextChangeListener) this);
    txtFiltroOficina.addListener((TextChangeListener) this);

    lstUsuarios = usuarioService.buscar(null);
    cargarUsuarios(lstUsuarios, true);
  }
  public void initUI() {
    try {
      setModal(true);
      VerticalLayout layout = (VerticalLayout) this.getContent();
      layout.setMargin(true);
      layout.setSpacing(true);
      layout.setStyleName(Reindeer.LAYOUT_WHITE);

      processesComboBox =
          new ComboBox(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("processToCategory"));
      processesComboBox.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
      //            processesComboBox.setItemCaptionPropertyId("name");
      processesComboBox.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_EXPLICIT);
      processesComboBox.setWidth("100%");

      bar.setWidth("100%");
      bar.addComponent(processesComboBox);
      bar.setExpandRatio(processesComboBox, 1);

      addBtn =
          new Button(ProcessbaseApplication.getCurrent().getPbMessages().getString("btnAdd"), this);
      bar.addComponent(addBtn);
      bar.setComponentAlignment(addBtn, Alignment.BOTTOM_RIGHT);

      layout.addComponent(bar);
      layout.addComponent(table);

      deleteBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnDelete"), this);
      deleteBtn.setDescription(
          ProcessbaseApplication.getCurrent().getPbMessages().getString("deleteCategory"));
      cancelBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnCancel"), this);
      saveBtn =
          new Button(
              ProcessbaseApplication.getCurrent().getPbMessages().getString("btnSave"), this);
      buttons.addButton(deleteBtn);
      buttons.setComponentAlignment(deleteBtn, Alignment.MIDDLE_RIGHT);
      buttons.addButton(saveBtn);
      buttons.setComponentAlignment(saveBtn, Alignment.MIDDLE_RIGHT);
      buttons.setExpandRatio(saveBtn, 1);
      buttons.addButton(cancelBtn);
      buttons.setComponentAlignment(cancelBtn, Alignment.MIDDLE_RIGHT);
      buttons.setMargin(false);
      buttons.setHeight("30px");
      buttons.setWidth("100%");
      addComponent(buttons);
      setWidth("70%");
      //            setHeight("70%");
      setResizable(false);

      table.addContainerProperty(
          "name",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionProcessName"),
          null,
          null);
      table.setColumnExpandRatio("name", 1);
      table.addContainerProperty(
          "version",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionVersion"),
          null,
          null);
      table.setColumnWidth("version", 50);
      table.addContainerProperty(
          "deployedBy",
          String.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionDeployedBy"),
          null,
          null);
      table.addContainerProperty(
          "actions",
          TableLinkButton.class,
          null,
          ProcessbaseApplication.getCurrent().getPbMessages().getString("tableCaptionActions"),
          null,
          null);
      table.setColumnWidth("actions", 50);
      table.setSelectable(false);
      table.setImmediate(true);
      table.setWidth("100%");
      table.setPageLength(10);
      refreshTable();
    } catch (Exception ex) {
      ex.printStackTrace();
      showError(ex.getMessage());
    }
  }
  public void initComponent() {
    table =
        new Table() {
          @Override
          protected String formatPropertyValue(Object rowId, Object colId, Property property) {
            // Format by property type
            try {
              if (property.getType() == Date.class && property.getValue() != null) {
                SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
                return df.format((Date) property.getValue());
              }
            } catch (Exception ex) {
            }

            try {
              if (property.getType() == Boolean.class) {
                if ((Boolean) property.getValue() == true) {
                  return "CLOSE";
                } else {
                  return "-";
                }
              }
            } catch (Exception ex) {
            }

            return super.formatPropertyValue(rowId, colId, property);
          }
        };

    // Inisialisasi Panel
    setSizeFull();
    content.setSizeFull();
    content.setMargin(true);

    // INIT COMPONENT TENGAH
    table.setSizeFull();
    table.setSelectable(true);
    table.setImmediate(true);
    table.setBuffered(false);
    table.setFooterVisible(true);

    // INIT COMPONENT ATAS
    btnSeparator1.setEnabled(false);
    btnSeparator2.setEnabled(false);

    //		fieldSearchByRekap = new TextField("NO. REKAP");
    fieldSearchById = new TextField("NO. REKAP");
    fieldSearchById.setInputPrompt("NO. REKAP");
    fieldSearchById.setStyleName(Reindeer.TEXTFIELD_SMALL);
    fieldSearchById.setWidth("120px");

    //		fieldSearchByInvoice = new TextField("INVOICE");
    comboSearchByDivision = new ComboBox("DIVISION");
    comboSearchByDivision.setInputPrompt("DIVISION");
    comboSearchByDivision.setStyleName(Reindeer.TEXTFIELD_SMALL);
    comboSearchByDivision.setWidth("120px");

    dateFieldSearchByTransdateFrom = new DateField("INV FROM");
    dateFieldSearchByTransdateFrom.setStyleName(Reindeer.TEXTFIELD_SMALL);
    dateFieldSearchByTransdateFrom.setWidth("120px");

    dateFieldSearchByTransdateTo = new DateField("INV TO");
    dateFieldSearchByTransdateTo.setStyleName(Reindeer.TEXTFIELD_SMALL);
    dateFieldSearchByTransdateTo.setWidth("120px");

    btnSearch.setStyleName(Reindeer.BUTTON_SMALL);

    btnSearch.setIcon(new ThemeResource("images/navigation/12x12/Find.png"));
    btnSelect.setIcon(new ThemeResource("images/navigation/16x16/OK.png"));
  }