/** * Returns the browse {@link Table} or {@link DataGrid}. Override the method if the table id differs from "table". */ @SuppressWarnings("unchecked") protected ListComponent<T> getTable() { return (ListComponent) getWindow().getComponentNN("table"); }
/** * Returns the right container with edit components. Override if the container id differs from "editBox". */ protected ComponentContainer getEditBox() { return (ComponentContainer) getWindow().getComponentNN("editBox"); }
/** * Returns the left container with browse components. Override if the container id differs from "lookupBox". */ protected ComponentContainer getLookupBox() { return (ComponentContainer) getWindow().getComponentNN("lookupBox"); }
/** * Returns the field group. Override if the field group id differs from "fieldGroup". */ protected Form getForm() { return (Form) getWindow().getComponentNN("form"); }
/** * Returns the container with edit actions (save, cancel). Override if the container id differs from "actionsPane". */ protected ComponentContainer getActionsPane() { return (ComponentContainer) getWindow().getComponentNN("actionsPane"); }
@SuppressWarnings("unchecked") protected LookupComponent<T> getLookupComponent() { com.haulmont.cuba.gui.screen.LookupComponent annotation = getClass().getAnnotation(com.haulmont.cuba.gui.screen.LookupComponent.class); if (annotation == null || Strings.isNullOrEmpty(annotation.value())) { throw new IllegalStateException( String.format("StandardLookup %s does not declare @LookupComponent", getClass()) ); } return (LookupComponent) getWindow().getComponentNN(annotation.value()); }
public void init(Map<String, Object> params) { super.init(params); Window parent = (Window) getFrame(); previewBox = (BoxLayout) parent.getComponentNN("previewBox"); }
protected void setFullName(String displayedName) { if (datasource != null) { datasource.getItem().setValue("name", displayedName); } else if (window != null) { Field field = (Field) window.getComponentNN("name"); field.setValue(displayedName); } else { fieldGroup.setFieldValue("name", displayedName); } }
protected String getFieldValue(String name) { if (datasource != null) { return datasource.getItem().getValue(name); } else if (window != null) { Field field = (Field) window.getComponentNN(name); return (String) field.getValue(); } else { return (String) fieldGroup.getFieldValue(name); } }
String filterComponentId = StringUtils.join(Arrays.copyOfRange(strings, 1, strings.length), '.'); filterComponent = (Filter) window.getComponentNN(filterComponentId);