Tabnine Logo
AbstractEditor.getItem
Code IndexAdd Tabnine to your IDE (free)

How to use
getItem
method
in
com.haulmont.cuba.gui.components.AbstractEditor

Best Java code snippets using com.haulmont.cuba.gui.components.AbstractEditor.getItem (Showing top 11 results out of 315)

origin: com.haulmont.cuba/cuba-gui

@Override
public T getEditedEntity() {
  return getItem();
}
origin: com.haulmont.addon.dashboard/dashboard-web

@Override
public Widget getItem() {
  Widget item = super.getItem();
  item.setCreatedBy(accessHelper.getCurrentSessionLogin());
  return item;
}
origin: com.haulmont.cuba/cuba-gui

public void validateAdditionalRules(ValidationErrors errors) {
  // all previous validations return no errors
  if (crossFieldValidate && errors.isEmpty()) {
    BeanValidation beanValidation = getBeanLocator().get(BeanValidation.NAME);
    Validator validator = beanValidation.getValidator();
    Set<ConstraintViolation<Entity>> violations = validator.validate(getItem(), UiCrossFieldChecks.class);
    violations.stream()
        .filter(violation -> {
          Path propertyPath = violation.getPropertyPath();
          Path.Node lastNode = Iterables.getLast(propertyPath);
          return lastNode.getKind() == ElementKind.BEAN;
        })
        .forEach(violation -> errors.add(violation.getMessage()));
  }
}
origin: com.haulmont.cuba/cuba-web

public void editAttribute() {
  Set<ManagedBeanAttribute> selected = attributesTable.getSelected();
  if (selected.isEmpty()) {
    return;
  }
  ManagedBeanAttribute mba = selected.iterator().next();
  if (!mba.getWriteable()) {
    return;
  }
  AbstractEditor w = openEditor("jmxConsoleEditAttribute", mba, OpenType.DIALOG);
  w.addCloseListener(actionId -> {
    if (Window.COMMIT_ACTION_ID.equals(actionId)) {
      Object item = w.getItem();
      reloadAttribute((ManagedBeanAttribute) item);
    }
  });
}
origin: com.haulmont.cuba/cuba-web

protected void showInfo(Object target) {
  AbstractEditor editor = (AbstractEditor) findEditor((Layout) target);
  Entity entity = editor.getItem();
  Metadata metadata = AppBeans.get(Metadata.NAME);
  MetaClass metaClass = metadata.getSession().getClass(entity.getClass());
  new ShowInfoAction().showInfo(entity, metaClass, editor);
}
origin: com.haulmont.cuba/cuba-gui

protected boolean commitInternal(boolean close) {
  if (!preCommit())
    return false;
  boolean committed;
  DsContext context = getDsContext();
  if (context != null) {
    committed = context.commit();
  } else {
    DataSupplier supplier = getDataService();
    supplier.commit(getItem());
    committed = true;
  }
  return postCommit(committed, close);
}
origin: com.haulmont.cuba/cuba-web

Entity editorItem = editor.getItem();
origin: com.haulmont.cuba/cuba-gui

/**
 * Hook to be implemented in subclasses. Called by the framework after committing datasources.
 * The default implementation notifies about commit and calls {@link #postInit()} if the window is not closing.
 *
 * @param committed whether any data were actually changed and committed
 * @param close     whether the window is going to be closed
 * @return true to continue, false to abort
 */
protected boolean postCommit(boolean committed, boolean close) {
  if (committed && !close) {
    if (showSaveNotification) {
      Entity entity = getItem();
      MetadataTools metadataTools = getBeanLocator().get(MetadataTools.class);
      showNotification(
          messages.formatMainMessage("info.EntitySave",
              messages.getTools().getEntityCaption(entity.getMetaClass()),
              metadataTools.getInstanceName(entity)),
          NotificationType.TRAY);
    }
    postInit();
    afterWindowApplyPostInit();
  }
  return true;
}
origin: com.haulmont.cuba/cuba-gui

Entity editedItem = window.getItem();
if (editedItem != null) {
  if (parentDs == null) {
origin: com.haulmont.cuba/cuba-gui

Entity editedItem = window.getItem();
if (editedItem != null) {
  if (parentDs == null) {
origin: com.haulmont.cuba/cuba-gui

editor.addCloseListener(actionId -> {
  if (Window.COMMIT_ACTION_ID.equals(actionId)) {
    Entity item = editor.getItem();
    afterCommitOpenedEntity(item);
com.haulmont.cuba.gui.componentsAbstractEditorgetItem

Popular methods of AbstractEditor

  • init
  • postInit
    Hook to be implemented in subclasses. Called by #setItem(com.haulmont.cuba.core.entity.Entity). At t
  • postCommit
    Hook to be implemented in subclasses. Called by the framework after committing datasources. The defa
  • preCommit
    Hook to be implemented in subclasses. Called by the framework when all validation is done and dataso
  • setItem
    Called by the framework to set an edited entity after creation of all components and datasources, an
  • addCloseListener
  • close
  • commit
    Commit changes with optional validation.Don't override this method in subclasses, use hooks #postVal
  • postValidate
  • validateAll
  • addAfterCloseListener
  • addCloseWithCommitListener
  • addAfterCloseListener,
  • addCloseWithCommitListener,
  • addInitListener,
  • afterWindowApplyPostInit,
  • closeWithCommit,
  • commitAndClose,
  • commitInternal,
  • getBeanLocator,
  • getContext

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
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