public void filterTasks(String text) {
   if (text.equals("")) {
     if (allTaskSummaries != null) {
       dataProvider.getList().clear();
       dataProvider.setList(new ArrayList<TaskSummary>(allTaskSummaries));
       dataProvider.refresh();
     }
     if (currentDayTasks != null) {
       view.getTaskListMultiDayBox().clear();
       for (Day day : currentDayTasks.keySet()) {
         view.getTaskListMultiDayBox()
             .addTasksByDay(day, new ArrayList<TaskSummary>(currentDayTasks.get(day)));
       }
       view.getTaskListMultiDayBox().refresh();
     }
   } else {
     if (allTaskSummaries != null) {
       List<TaskSummary> tasks = new ArrayList<TaskSummary>(allTaskSummaries);
       List<TaskSummary> filteredTasksSimple = new ArrayList<TaskSummary>();
       for (TaskSummary ts : tasks) {
         if (ts.getName().toLowerCase().contains(text.toLowerCase())) {
           filteredTasksSimple.add(ts);
         }
       }
       dataProvider.getList().clear();
       dataProvider.setList(filteredTasksSimple);
       dataProvider.refresh();
     }
     if (currentDayTasks != null) {
       Map<Day, List<TaskSummary>> tasksCalendar =
           new HashMap<Day, List<TaskSummary>>(currentDayTasks);
       Map<Day, List<TaskSummary>> filteredTasksCalendar = new HashMap<Day, List<TaskSummary>>();
       view.getTaskListMultiDayBox().clear();
       for (Day d : tasksCalendar.keySet()) {
         if (filteredTasksCalendar.get(d) == null) {
           filteredTasksCalendar.put(d, new ArrayList<TaskSummary>());
         }
         for (TaskSummary ts : tasksCalendar.get(d)) {
           if (ts.getName().toLowerCase().contains(text.toLowerCase())) {
             filteredTasksCalendar.get(d).add(ts);
           }
         }
       }
       for (Day day : filteredTasksCalendar.keySet()) {
         view.getTaskListMultiDayBox()
             .addTasksByDay(day, new ArrayList<TaskSummary>(filteredTasksCalendar.get(day)));
       }
       view.getTaskListMultiDayBox().refresh();
     }
   }
 }
예제 #2
0
 @Override
 public void renderRows(List<EntityModalPresenter.VariableValueRow> rows) {
   dataProvider.setList(rows);
   pager.firstPage();
   dataProvider.refresh();
   pager.setPagerVisible(dataProvider.getList().size() > pager.getPageSize());
 }
예제 #3
0
 public void updateChanges(List<ModelNode> _changes) {
   dataProvider.setList(_changes);
   table.selectDefaultEntity();
   this.changes.clear();
   this.changes.addAll(_changes);
   detailsConfigurationChange.clearValue();
 }
예제 #4
0
  @Override
  public void updateFrom(EESubsystem eeSubsystem) {
    form.edit(eeSubsystem);
    dataProvider.setList(eeSubsystem.getModules());

    moduleList.selectDefaultEntity();
  }
예제 #5
0
  public void setStack(JGroupsStack stack) {
    this.selectedStack = stack;

    headline.setText("Protocols: Stack " + stack.getName());

    dataProvider.setList(stack.getProtocols());
    table.selectDefaultEntity();
  }
예제 #6
0
파일: IOPanel.java 프로젝트: hal/core
 public void update(final List<Property> models) {
   dataProvider.setList(models);
   if (models.isEmpty()) {
     selectionModel.clear();
   } else {
     table.selectDefaultEntity();
   }
   SelectionChangeEvent.fire(
       selectionModel); // updates ModelNodeForm's editedEntity with current value
 }
예제 #7
0
 public void setEnabled(final boolean enabled) {
   if (enabled) {
     enableBtn.setVisible(false);
     disableBtn.setVisible(true);
     refreshBtn.setEnabled(true);
   } else {
     enableBtn.setVisible(true);
     disableBtn.setVisible(false);
     refreshBtn.setEnabled(false);
     dataProvider.setList(Collections.emptyList());
   }
   detailsConfigurationChange.clearValue();
 }
예제 #8
0
  public void setAdapter(ResourceAdapter adapter) {

    this.currentAdapter = adapter;

    configProperties.clearValues();

    headline.setText("Resource Adapter: " + adapter.getArchive());

    List<AdminObject> list = adapter.getAdminObjects();
    dataProvider.setList(list);

    table.selectDefaultEntity();
  }
예제 #9
0
  @Override
  public void setDataList(List<KscReportDetail> dataList) {
    m_dataList.setList(dataList);

    m_popupPanel.setPopupPositionAndShow(
        new PositionCallback() {

          @Override
          public void setPosition(int offsetWidth, int offsetHeight) {
            m_popupPanel.setWidth((getOffsetWidth() - 5) + "px");
            m_popupPanel.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + 24);
          }
        });
  }
예제 #10
0
  public void setDiverts(List<ActivemqDivert> diverts) {
    provider.setList(diverts);
    serverName.setText("Diverts: Provider " + presenter.getCurrentServer());
    table.selectDefaultEntity();

    // populate oracle
    presenter.loadExistingQueueNames(
        new AsyncCallback<List<String>>() {
          @Override
          public void onFailure(Throwable throwable) {}

          @Override
          public void onSuccess(List<String> names) {
            divertForm.setQueueNames(names);
          }
        });
  }
예제 #11
0
  public void showReport(final AnalysisReport report) {
    currentReport = report;

    if (!report.getAnalysisData().isEmpty()) {
      placeManager.goTo(IDENTIFIER);
    } else {
      placeManager.closePlace(IDENTIFIER);
    }

    dataProvider.setList(report.getAnalysisData());

    if (dataProvider.getList().isEmpty()) {
      view.clearIssue();
    } else {
      view.show(dataProvider.getList().get(0));
    }
  }
예제 #12
0
  public void setChildren(
      ModelNode address,
      List<ModelNode> modelNodes,
      ModelBrowserView.ChildInformation childInformation) {

    this.currentAddress = address;
    this.childInformation = childInformation;

    String denominatorType = AddressUtils.getDenominatorType(address.asPropertyList());
    boolean isSingleton =
        denominatorType != null ? childInformation.isSingleton(denominatorType) : false;

    String text = isSingleton ? "Singleton Child Resources" : "Child Resources";
    header.setHTML(
        "<h2 class='homepage-secondary-header'>" + text + " (" + modelNodes.size() + ")</h2>");
    dataProvider.setList(modelNodes);
  }
예제 #13
0
  public void createOffersTable() {

    // Create tweet column.
    TextColumn<Offre> titleCollumn =
        new TextColumn<Offre>() {
          @Override
          public String getValue(Offre offre) {
            return offre.getLibelle();
          }
        };

    // Create tweet column.
    TextColumn<Offre> priceColumn =
        new TextColumn<Offre>() {
          @Override
          public String getValue(Offre offre) {
            return String.valueOf(offre.getPrix());
          }
        };

    final MultiSelectionModel<Offre> multiSelectionModel = new MultiSelectionModel<Offre>();
    cellTable.setSelectionModel(
        multiSelectionModel, DefaultSelectionEventManager.<Offre>createCheckboxManager());

    Column<Offre, Boolean> checkColumn =
        new Column<Offre, Boolean>(new CheckboxCell(true, false)) {

          @Override
          public Boolean getValue(Offre object) {
            return multiSelectionModel.isSelected(object);
          }
        };

    // Add the columns.
    cellTable.addColumn(checkColumn);
    cellTable.addColumn(titleCollumn, "Intitulle");
    cellTable.addColumn(priceColumn, "Prix");
    ArrayList<Offre> tmp = OffreDAO.selectAll();
    listOffers.setList(tmp);

    listOffers.addDataDisplay(cellTable);

    final SimplePager pager = new SimplePager();
    pager.setDisplay(cellTable);
  }
예제 #14
0
  private void filter(String word) {
    final List<ModelNode> filteredChanges = new ArrayList<>();
    word = word.toLowerCase();
    for (ModelNode node : changes) {
      String access = node.get("access-mechanism").asString().toLowerCase();
      String clientAddress = node.get("remote-address").asString().toLowerCase();
      String outcome = node.get("outcome").asString().toLowerCase();
      String address = extractResourceAddress(node).toLowerCase();
      String opname = node.get(OPERATIONS).get(0).get(OP).asString().toLowerCase();

      if (access.contains(word)
          || clientAddress.contains(word)
          || outcome.contains(word)
          || address.contains(word)
          || opname.contains(word)) filteredChanges.add(node);
    }
    dataProvider.setList(filteredChanges);
  }
  public void setDocument(final Document document) {
    current = document;
    if (document != null) {
      // Fill up the form with the document details
      view.setId(document.getId());
      view.setType(document.getType());
      view.setName(document.getName());
      view.setDescription(document.getDescription());
      view.setContent(document.getContent());
      view.setNewDocument(document.isNew());
      attributesDataProvider.setList(document.getAttributes());

      // Make the view visible
      view.asWidget().setVisible(true);
    } else {
      // Clear the form and hide the view
      view.asWidget().setVisible(false);
    }
  }
예제 #16
0
  @SuppressWarnings("ParameterHidesMemberVariable")
  public void populate(List<ValueMapEntry> valueMapEntries, @Nullable List<String> valueChoices) {
    this.valueMapEntries = valueMapEntries;
    this.valueChoices = valueChoices;
    //noinspection ConstantConditions
    if (hasValueChoices() && !valueChoices.contains("")) {
      valueChoices.add(0, "");
    }

    if (dataProvider == null) {
      initializeTable();
      dataProvider = new ListDataProvider<ValueMapEntry>(valueMapEntries);
      dataProvider.addDataDisplay(table);
    } else {
      dataProvider.setList(valueMapEntries);
    }
    pager.setVisible(valueMapEntries.size() > pager.getPageSize());
    dataProvider.refresh();

    // remove loading
    remove(loading);
    // addStyleName("value-map");
  }
예제 #17
0
 private void populateTable(List<DataShieldROptionDto> options) {
   dataProvider.setList(options);
   pager.firstPage();
   dataProvider.refresh();
   pager.setPagerVisible(dataProvider.getList().size() > pager.getPageSize());
 }
예제 #18
0
 public void setSecurityConfig(List<ActivemqSecurityPattern> patterns) {
   secProvider.setList(patterns);
   secTable.selectDefaultEntity();
   form.setEnabled(false);
   serverName.setText("Security Settings: Provider " + presenter.getCurrentServer());
 }
예제 #19
0
 public void updateFrom(String groupName, List<SocketBinding> bindings) {
   dataProvider.setList(bindings);
   if (!bindings.isEmpty() && table.getSelectionModel() != null)
     table.getSelectionModel().setSelected(bindings.get(0), true);
 }
예제 #20
0
 public void clearValues() {
   dataProvider.setList(new ArrayList<>());
 }
예제 #21
0
 public void setPhenotypeList(List<Phenotype> phenotypes) {
   phenotypeDataProvider.setList(phenotypes);
 }
예제 #22
0
  public DataObjectBrowser() {
    initWidget(uiBinder.createAndBindUi(this));

    objectButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            selectCurrentObject(true);
          }
        });

    dataObjectPropertiesProvider.setList(new ArrayList<ObjectProperty>());

    // Init data objects table

    dataObjectPropertiesTable.setEmptyTableWidget(
        new Label(Constants.INSTANCE.objectBrowser_emptyTable()));

    // Init property name column

    final TextColumn<ObjectProperty> propertyNameColumn =
        new TextColumn<ObjectProperty>() {

          @Override
          public void render(Cell.Context context, ObjectProperty object, SafeHtmlBuilder sb) {
            SafeHtml startDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "<div style=\"cursor: pointer;\">";
                  }
                };
            SafeHtml endDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "</div>";
                  }
                };

            sb.append(startDiv);
            super.render(context, object, sb);
            sb.append(endDiv);
          }

          @Override
          public String getValue(final ObjectProperty objectProperty) {
            return objectProperty.getName();
          }
        };

    propertyNameColumn.setSortable(true);
    dataObjectPropertiesTable.addColumn(
        propertyNameColumn, Constants.INSTANCE.objectBrowser_columnName());
    // dataObjectPropertiesTable.setColumnWidth(propertyNameColumn, 100, Style.Unit.PX);
    dataObjectPropertiesTable.setColumnWidth(propertyNameColumn, 30, Style.Unit.PCT);

    ColumnSortEvent.ListHandler<ObjectProperty> propertyNameColHandler =
        new ColumnSortEvent.ListHandler<ObjectProperty>(dataObjectPropertiesProvider.getList());
    propertyNameColHandler.setComparator(propertyNameColumn, new ObjectPropertyComparator("name"));
    dataObjectPropertiesTable.addColumnSortHandler(propertyNameColHandler);

    // Init property Label column

    final TextColumn<ObjectProperty> propertyLabelColumn =
        new TextColumn<ObjectProperty>() {

          @Override
          public void render(Cell.Context context, ObjectProperty object, SafeHtmlBuilder sb) {
            SafeHtml startDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "<div style=\"cursor: pointer;\">";
                  }
                };
            SafeHtml endDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "</div>";
                  }
                };

            sb.append(startDiv);
            super.render(context, object, sb);
            sb.append(endDiv);
          }

          @Override
          public String getValue(final ObjectProperty objectProperty) {
            return AnnotationValueHandler.getStringValue(
                objectProperty,
                MainDomainAnnotations.LABEL_ANNOTATION,
                MainDomainAnnotations.VALUE_PARAM);
          }
        };

    propertyLabelColumn.setSortable(true);
    dataObjectPropertiesTable.addColumn(
        propertyLabelColumn, Constants.INSTANCE.objectBrowser_columnLabel());
    dataObjectPropertiesTable.setColumnWidth(propertyLabelColumn, 30, Style.Unit.PCT);

    ColumnSortEvent.ListHandler<ObjectProperty> propertyLabelColHandler =
        new ColumnSortEvent.ListHandler<ObjectProperty>(dataObjectPropertiesProvider.getList());
    propertyNameColHandler.setComparator(
        propertyLabelColumn, new ObjectPropertyComparator("label"));
    dataObjectPropertiesTable.addColumnSortHandler(propertyLabelColHandler);

    // Init property type browsing column
    ClickableImageResourceCell typeImageCell = new ClickableImageResourceCell(true, 25);
    //        final TooltipCellDecorator<ImageResource> typeImageDecorator = new
    // TooltipCellDecorator<ImageResource>( typeImageCell );
    //        typeImageDecorator.setText(
    // Constants.INSTANCE.objectBrowser_action_goToDataObjectDefinition() );

    final Column<ObjectProperty, ImageResource> typeImageColumn =
        new Column<ObjectProperty, ImageResource>(typeImageCell) {
          @Override
          public ImageResource getValue(final ObjectProperty property) {

            if (!property.isBaseType()
                && !getDataObject().getClassName().equals(property.getClassName())
                && !getDataModel().isExternal(property.getClassName())) {
              return ImagesResources.INSTANCE.BrowseObject();
            } else {
              return null;
            }
          }
        };

    typeImageColumn.setFieldUpdater(
        new FieldUpdater<ObjectProperty, ImageResource>() {
          public void update(
              final int index, final ObjectProperty property, final ImageResource value) {

            onTypeCellSelection(property);
          }
        });

    dataObjectPropertiesTable.addColumn(typeImageColumn);

    // Init property type column
    final TextColumn<ObjectProperty> propertyTypeColumn =
        new TextColumn<ObjectProperty>() {

          @Override
          public void render(Cell.Context context, ObjectProperty object, SafeHtmlBuilder sb) {
            SafeHtml startDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "<div style=\"cursor: pointer;\">";
                  }
                };
            SafeHtml endDiv =
                new SafeHtml() {
                  @Override
                  public String asString() {
                    return "</div>";
                  }
                };

            sb.append(startDiv);
            super.render(context, object, sb);
            sb.append(endDiv);
          }

          @Override
          public String getValue(final ObjectProperty objectProperty) {
            return propertyTypeDisplay(objectProperty);
          }
        };
    propertyTypeColumn.setSortable(true);
    dataObjectPropertiesTable.addColumn(
        propertyTypeColumn, Constants.INSTANCE.objectBrowser_columnType());
    dataObjectPropertiesTable.setColumnWidth(propertyTypeColumn, 40, Style.Unit.PCT);

    // Init delete column
    final Column<ObjectProperty, String> deletePropertyColumnImg =
        new Column<ObjectProperty, String>(deleteCell) {
          @Override
          public String getValue(final ObjectProperty global) {
            return "Remove";
          }
        };

    deletePropertyColumnImg.setFieldUpdater(
        new FieldUpdater<ObjectProperty, String>() {
          public void update(final int index, final ObjectProperty property, final String value) {
            if (!isReadonly()) {
              checkAndDeleteDataObjectProperty(property, index);
            }
          }
        });

    dataObjectPropertiesTable.addColumn(deletePropertyColumnImg);

    ColumnSortEvent.ListHandler<ObjectProperty> propertyTypeColHandler =
        new ColumnSortEvent.ListHandler<ObjectProperty>(dataObjectPropertiesProvider.getList());
    propertyTypeColHandler.setComparator(
        propertyTypeColumn, new ObjectPropertyComparator("className"));
    dataObjectPropertiesTable.addColumnSortHandler(propertyTypeColHandler);

    dataObjectPropertiesTable.getColumnSortList().push(propertyNameColumn);

    // Init the selection model
    SingleSelectionModel<ObjectProperty> selectionModel =
        new SingleSelectionModel<ObjectProperty>();
    dataObjectPropertiesTable.setSelectionModel(selectionModel);
    selectionModel.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {

          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            ObjectProperty selectedProperty =
                ((SingleSelectionModel<ObjectProperty>)
                        dataObjectPropertiesTable.getSelectionModel())
                    .getSelectedObject();
            notifyFieldSelected(selectedProperty);
          }
        });

    dataObjectPropertiesTable.setKeyboardSelectionPolicy(
        HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.BOUND_TO_SELECTION);

    dataObjectPropertiesTable.addCellPreviewHandler(
        new CellPreviewEvent.Handler<ObjectProperty>() {

          @Override
          public void onCellPreview(CellPreviewEvent<ObjectProperty> event) {
            if (showingObject && "click".equals(event.getNativeEvent().getType())) {
              int selectedRow = dataObjectPropertiesTable.getKeyboardSelectedRow();
              if (lastSelectedRow >= 0 && lastSelectedRow == selectedRow) {
                ObjectProperty selectedProperty =
                    dataObjectPropertiesProvider.getList().get(selectedRow);
                ((SingleSelectionModel<ObjectProperty>)
                        dataObjectPropertiesTable.getSelectionModel())
                    .setSelected(selectedProperty, true);
              }
              showingObject = false;
            }
          }
        });

    dataObjectPropertiesProvider.addDataDisplay(dataObjectPropertiesTable);
    dataObjectPropertiesProvider.refresh();

    newPropertyButton.setIcon(IconType.PLUS);

    setReadonly(true);
  }
예제 #23
0
 @Override
 public void renderRows(JsArray<TableDto> rows) {
   dataProvider.setList(JsArrays.toList(JsArrays.toSafeArray(rows)));
   pager.firstPage();
 }
  @Override
  public void setSummaryDTOList(final List<SummaryDTO> summaries) {

    /*ProvidesKey<SummaryDTO> keyProvider = new ProvidesKey<SummaryDTO>()
    		{
    		      public Object getKey(SummaryDTO item) {
    		        // Always do a null check.
    		        return (item == null) ? null : item.getIdentifier();
    		      }
    		    };

    		SimplePager pager = new SimplePager();
    		SummaryCell summaryCell = new SummaryCell(this);
    		summaryList = new CellList<SummaryDTO>(summaryCell, keyProvider);
    		summaryList.setVisibleRange(0, displayRange);

    		AsyncDataProvider<SummaryDTO> dataProvider = new AsyncDataProvider<SummaryDTO>()
    				{

    					@Override
    					protected void onRangeChanged(HasData<SummaryDTO> display)
    					{
    						Range range = display.getVisibleRange();
    						int start = range.getStart();
    				        int end = start + range.getLength();
    				        //pager.startLoading();
    				        List<SummaryDTO> redux = summaries.subList(start, end);

    				        summaryList.setRowData(start, redux);


    					}};
    		dataProvider.addDataDisplay(summaryList);
    		pager.setDisplay(summaryList);

    //		pager.setPageSize(4);


    		loadingPanel.setVisible(false);

    		*/

    ProvidesKey<SummaryDTO> keyProvider =
        new ProvidesKey<SummaryDTO>() {
          public Object getKey(SummaryDTO item) {
            // Always do a null check.
            return (item == null) ? null : item.getUuid();
          }
        };

    SimplePager pager = new SimplePager();
    SummaryCell summaryCell = new SummaryCell(this);
    summaryList = new CellList<SummaryDTO>(summaryCell, keyProvider);
    ListDataProvider<SummaryDTO> dataProvider = new ListDataProvider<SummaryDTO>();
    dataProvider.setList(summaries);
    dataProvider.addDataDisplay(summaryList);
    pager.setDisplay(summaryList);
    pagerPanel.clear();
    pagerPanel.add(pager);
    dataPanel.clear();
    dataPanel.add(summaryList);
    pager.setPageSize(displayRange);
  }
예제 #25
0
  public void updateFrom(List<MailSession> list) {
    dataProvider.setList(list);

    table.selectDefaultEntity();
  }
예제 #26
0
 private void clearFilter() {
   dataProvider.setList(changes);
 }