Tabnine Logo
AttrGroup
Code IndexAdd Tabnine to your IDE (free)

How to use
AttrGroup
in
de.micromata.genome.db.jpa.tabattr.api

Best Java code snippets using de.micromata.genome.db.jpa.tabattr.api.AttrGroup (Showing top 17 results out of 315)

origin: micromata/projectforge

@Override
public AttrGroup getAttrGroup(final EntityWithConfigurableAttr entity, final String groupName)
{
 if (attrSchemata == null) {
  loadAttrSchema();
 }
 final AttrSchema entitySchema = attrSchemata.get(entity.getAttrSchemaName());
 return entitySchema
   .getGroups()
   .stream()
   .filter(group -> group.getName().equals(groupName))
   .findFirst()
   .orElse(null);
}
origin: micromata/projectforge

 @Override
 public AttrDescription getAttrDescription(final AttrGroup attrGroup, final String descriptionName)
 {
  return (attrGroup == null) ? null :
    attrGroup
      .getDescriptions()
      .stream()
      .filter(desc -> desc.getPropertyName().equals(descriptionName))
      .findFirst()
      .orElse(null);
 }
}
origin: micromata/projectforge

public BaseAttributePanel(final String id, final AttrGroup attrGroup)
{
 super(id);
 this.attrGroup = attrGroup;
 add(container);
 container.setOutputMarkupId(true);
 final String i18nKey = attrGroup.getI18nKey();
 final String heading = (i18nKey != null) ? getString(i18nKey) : null;
 container.add(new Label("heading", heading));
}
origin: micromata/projectforge

private void createDatepicker(T attrRow, GridBuilder gridBuilder)
{
 final String startTimeLabel = getString(attrGroup.getI18nKeyStartTime());
 final FieldsetPanel dateFs = gridBuilder.newFieldset(startTimeLabel);
 final PropertyModel<Date> dateModel = new PropertyModel<>(attrRow, "startTime");
 final DatePanel dp = new DatePanel(dateFs.newChildId(), dateModel,
   DatePanelSettings.get().withTargetType(java.sql.Date.class));
 dp.setRequired(true);
 dp.add(this::validateDate);
 dateFs.add(dp);
 final DateTextField dateField = dp.getDateField();
 dateField.setMarkupId(attrGroup.getName() + "-startTime").setOutputMarkupId(true);
}
origin: micromata/projectforge

 private <PK extends Serializable, T extends TimeableAttrRow<PK>, U extends EntityWithConfigurableAttr & EntityWithTimeableAttr<PK, T>> void createTimedAttrPanel(
   final DivPanel divPanel, final U entity, final AbstractEditPage<?, ?, ?> parentPage,
   final Function<AttrGroup, T> addNewEntryFunction, final AttrGroup group)
 {
  switch (group.getType()) {
   case PERIOD:
   case INSTANT_OF_TIME:
    divPanel.add(new TimedAttributePanel<>(divPanel.newChildId(), group, entity, parentPage, addNewEntryFunction));
    break;

   default:
    log.error("The Type " + group.getType() + " is not supported.");
    break;
  }
 }
}
origin: micromata/projectforge

private void validateDate(IValidatable<Date> iValidatable)
{
 final Date dateToValidate = iValidatable.getValue();
 final T selectedAttrRow = selectedAttrRowModel.getObject();
 DayMonthGranularity gran = attrGroup.getDayMonthGranularity();
 if (gran == null) {
  gran = DayMonthGranularity.DAY;
 }
 Predicate<T> predicate;
 String errorKey;
 switch (gran) {
  case MONTH:
   predicate = row -> DateUtils.isSameMonth(row.getStartTime(), dateToValidate);
   errorKey = "attr.starttime.alreadyexists.month";
   break;
  default:
   predicate = row -> DateHelper.isSameDay(row.getStartTime(), dateToValidate);
   errorKey = "attr.starttime.alreadyexists.day";
 }
 final boolean thereIsAlreadyAnEntryWithTheSameDate = getTimeableAttrRowsOfThisGroup()
   .stream()
   // remove the currently selected entry from the stream, otherwise this will always be true if you don't change the date
   .filter(row -> !row.equals(selectedAttrRow))
   .anyMatch(predicate);
 if (thereIsAlreadyAnEntryWithTheSameDate) {
  iValidatable.error(new ValidationError().addKey(errorKey));
 }
}
origin: micromata/projectforge

@Override
public <PK extends Serializable, T extends TimeableAttrRow<PK>, U extends EntityWithConfigurableAttr & EntityWithTimeableAttr<PK, T> & EntityWithAttributes> void createAttrPanels(
  final TabPanel tabPanel, final U entity, final AbstractEditPage<?, ?, ?> parentPage,
  final Function<AttrGroup, T> addNewEntryFunction)
{
 final AttrSchema attrSchema = getAttrSchema(entity.getAttrSchemaName());
 if (attrSchema == null) {
  return;
 }
 for (AttrGroup group : attrSchema.getGroups()) {
  final GridBuilder tabContainer = tabPanel.getOrCreateTab(group.getI18nKeySubmenu());
  final DivPanel divPanel = tabContainer.getPanel();
  if (!divPanel.hasChilds()) {
   // this panel is fresh, we have to add our css class
   addHtmlClass(divPanel);
  }
  createAttrPanel(divPanel, entity, parentPage, addNewEntryFunction, group);
 }
}
origin: micromata/projectforge

private <PK extends Serializable, T extends TimeableAttrRow<PK>, U extends EntityWithConfigurableAttr & EntityWithTimeableAttr<PK, T> & EntityWithAttributes> void createAttrPanel(
  final DivPanel divPanel, final U entity, final AbstractEditPage<?, ?, ?> parentPage,
  final Function<AttrGroup, T> addNewEntryFunction,
  final AttrGroup group)
{
 switch (group.getType()) {
  case PERIOD:
  case INSTANT_OF_TIME:
   divPanel.add(new TimedAttributePanel<>(divPanel.newChildId(), group, entity, parentPage, addNewEntryFunction));
   break;
  case NOT_TIMEABLE:
   divPanel.add(new AttributePanel(divPanel.newChildId(), group, entity));
   break;
  default:
   log.error("The Type " + group.getType() + " is not supported.");
   break;
 }
}
origin: micromata/projectforge

 default void setAndOutputMarkupId(final Component component, final AttrGroup group, final AttrDescription desc)
 {
  component.setMarkupId(group.getName() + "-" + desc.getPropertyName()).setOutputMarkupId(true);
 }
}
origin: micromata/projectforge

@Override
public Map<String, SearchColumnMetadata> getAdditionallySearchFields(EntityMetadata entm,
  String params)
{
 Map<String, SearchColumnMetadata> ret = new HashMap<>();
 AttrSchemaService service = AttrSchemaServiceSpringBeanImpl.get();
 AttrSchema schema = service.getAttrSchema(params);
 if (schema != null) {
  for (AttrGroup group : schema.getGroups()) {
   for (AttrDescription ad : group.getDescriptions()) {
    ColumnMetadata cmd = getColumnMetadataFromColumnDesc(entm, ad);
    SearchColumnMetadataBean scmd = new SearchColumnMetadataBean(ad.getPropertyName(), cmd);
    scmd.setIndexType(String.class);
    scmd.setIndexed(true);
    ret.put(ad.getPropertyName(), scmd);
   }
  }
  return ret;
 } else {
  log.info("Can't get AttrSchema. Continoue without.");
  return null;
 }
}
origin: micromata/projectforge

private Button createDeleteButton()
{
 final Button deleteButton = new Button("deleteButton");
 deleteButton.add(new AjaxEventBehavior("click")
 {
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
   // open dialog only if an attr row is selected
   if (selectedAttrRowModel.getObject() != null) {
    deleteDialog.open(target);
   }
  }
 });
 deleteButton.setMarkupId(attrGroup.getName() + "-deleteButton").setOutputMarkupId(true);
 return deleteButton;
}
origin: micromata/projectforge

 protected DivPanel createContent(final EntityWithAttributes entity, final Consumer<GridBuilder> gridBuilderConsumer)
 {
  final GridBuilder gridBuilder = new GridBuilder(null, "content");
  gridBuilder.newSplitPanel(GridSize.COL100);

  // this can be used to create content before the rest of the content is created
  if (gridBuilderConsumer != null) {
   gridBuilderConsumer.accept(gridBuilder);
  }

  // create the content according to the descriptions of this group (from the xml file)
  for (final AttrDescription desc : attrGroup.getDescriptions()) {
   final String label = getString(desc.getI18nkey());
   final FieldsetPanel fs = gridBuilder.newFieldset(label);
   final ComponentWrapperPanel component = attrSchemaService.createWicketComponent(fs.newChildId(), attrGroup, desc, entity);
   fs.add((Component) component);
  }

  return gridBuilder.getMainContainer();
 }
}
origin: micromata/projectforge

@Override
protected void init()
{
 super.init();
 // AttrPanels
 gridBuilder.newSplitPanel(GridSize.COL100, true); // set hasSubSplitPanel to true to remove borders from this split panel
 final DivPanel divPanel = gridBuilder.getPanel();
 final Function<AttrGroup, EmployeeConfigurationTimedDO> addNewEntryFunction = group -> employeeConfigurationService
   .addNewTimeAttributeRow(data, group.getName());
 attrSchemaService.createAttrPanels(divPanel, data, parentPage, addNewEntryFunction);
}
origin: micromata/projectforge

private Button createAddButton()
{
 final Button addButton = new Button("addButton");
 addButton.add(new AjaxEventBehavior("click")
 {
  @Override
  protected void onEvent(AjaxRequestTarget target)
  {
   if (!isDirty) {
    addAndSelectNewEntry();
    updateChoicesOfDateDropDown(false);
    container.addOrReplace(createContentWithDatepicker());
    target.add(container);
    // a new attr row must be dirty because it is new and must be saved
    isDirty = true;
   } else {
    // this indicates that the add button was clicked in onBeforeRender
    newSelectedAttrRow = null;
    saveChangesDialog.open(target);
   }
  }
 });
 addButton.setMarkupId(attrGroup.getName() + "-addButton").setOutputMarkupId(true);
 return addButton;
}
origin: micromata/projectforge

dropDown.setMarkupId(attrGroup.getName() + "-dateDropDown").setOutputMarkupId(true);
return dropDown;
origin: micromata/projectforge

  .addNewTimeAttributeRow(data, group.getName());
attrSchemaService.createAttrPanels(tabPanel, data, parentPage, addNewEntryFunction);
origin: micromata/projectforge

final Function<AttrGroup, VisitorbookTimedDO> addNewEntryFunction = group -> visitorbookService.addNewTimeAttributeRow(data, group.getName());
attrSchemaService.createTimedAttrPanels(gridBuilder.getPanel(), data, parentPage, addNewEntryFunction);
de.micromata.genome.db.jpa.tabattr.apiAttrGroup

Most used methods

  • getName
  • getDescriptions
  • getDayMonthGranularity
  • getI18nKey
  • getI18nKeyStartTime
  • getI18nKeySubmenu
  • getType

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now