Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Attribute


        && constructionType.getConstructionTypeId() != null) {
      manager.removeConstructionType(constructionType);
    }
    AttributeManager attManager = (AttributeManager) ModelUtil
    .getBean("attributeManager");
    Attribute attribute = attManager.findByName("test");
    if(attribute!=null){
      attManager.removeAttribute(attribute);
    }
  }
View Full Code Here


    constructionType.setProductArea(productArea);

    AttributeManager attManager = (AttributeManager) ModelUtil
        .getBean("attributeManager");

    Attribute attribute = new Attribute(null, "test", null, null, null,
        null, null, null,null,null,null);
    attManager.saveAttribute(attribute);
    ConstructionTypeAttribute att = new ConstructionTypeAttribute(null,
        constructionType, attribute, "test", null, null);
    HashSet<ConstructionTypeAttribute> attributes = new HashSet<ConstructionTypeAttribute>();
View Full Code Here

  public void tearDown() throws Exception {
    dialogFixture.cleanUp();

    AttributeManager attributeManager = (AttributeManager) ModelUtil
        .getBean("attributeManager");
    Attribute attribute = attributeManager.findByName("testing");

    if (attribute != null) {
      attributeManager.removeAttribute(attribute);
    }
  }
View Full Code Here

    AttributeViewHandler attributeViewHandler = new AttributeViewHandler(
        login, managerRepository);

    final EditAttributeView editAttributeView = new EditAttributeView(
        attributeViewHandler, new Attribute(), false);

    JDialog dialog = GuiActionRunner.execute(new GuiQuery<JDialog>() {
      protected JDialog executeInEDT() {
        JDialog dialog = new JDialog();
        WindowInterface window = new JDialogAdapter(dialog);
View Full Code Here

    when(login.getUserType()).thenReturn(userType);

    final AttributeChoiceOverviewView view = new AttributeChoiceOverviewView(
        new AttributeChoiceViewHandler(login, managerRepository,
            new AttributeModel(new Attribute())));

    JDialog dialog = GuiActionRunner.execute(new GuiQuery<JDialog>() {
      protected JDialog executeInEDT() {
        JDialog dialog = new JDialog();
        WindowInterface window = new JDialogAdapter(dialog);
View Full Code Here

public class AttributeManagerImpl extends ManagerImpl<Attribute>implements AttributeManager {
    /**
     * @see no.ugland.utransprod.service.AttributeManager#findByName(java.lang.String)
     */
    public final Attribute findByName(final String name) {
        Attribute att = new Attribute();
        att.setName(name);
        List<Attribute> list = dao.findByExample(att);
        if (list == null || list.size() != 1) {
            return null;
        }
        return list.get(0);
View Full Code Here

      dialog.setVisible(true);

      List<Attribute> newAttributes = attributeView.getSelectedObjects();
      if (newAttributes != null && newAttributes.size() == 1) {

        Attribute att = newAttributes.get(0);
        Object[] selectionValues = null;
        List<String> choices = att.getChoices();
        if (choices != null && choices.size() != 0) {
          selectionValues = choices.toArray();
        } else if (att.getYesNo() != null && att.getYesNo() > 0) {
          selectionValues = new Object[] { "Ja", "Nei" };
        }
        String attributeValue = (String) JOptionPane.showInputDialog(
            window.getComponent(), "Gi attributt verdi",
            "Attributt", JOptionPane.PLAIN_MESSAGE, null,
            selectionValues, null);

        if (attributeValue == null || attributeValue.length() == 0) {
          Util.showErrorDialog(window.getComponent(), "Feil",
              "Attributt m� ha verdi");
        } else {
          ExternalOrderLine externalOrderLine = ((ExternalOrderLineModel) presentationModel
              .getBean()).getObject();
          ExternalOrderLineAttribute externalOrderLineAttribute = new ExternalOrderLineAttribute(
              null, externalOrderLine, attributeValue, att
                  .getName());
          attributes.add(externalOrderLineAttribute);
          externalAttributeList.add(externalOrderLineAttribute);
        }
      }
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.handlers.AbstractViewHandler#getNewObject()
   */
  @Override
  public Attribute getNewObject() {
    return new Attribute();
  }
View Full Code Here

     * @param rowIndex
     * @param columnIndex
     * @return verdi
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      Attribute attribute = (Attribute) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return attribute.getName();
      case 1:
        return attribute.getDescription();
      case 2:
        return Util.convertNumberToBoolean(attribute.getYesNo());
      case 3:
        return Util.convertNumberToBoolean(attribute
            .getSpecialConcern());
      default:
        throw new IllegalStateException("Unknown column");
      }

View Full Code Here

            "Skal gjelde alle gjelende grasjetype",
            JOptionPane.PLAIN_MESSAGE, null, new Object[] { "Ja",
                "Nei" }, null);
      }

      Attribute att = newAttributes.get(0);
      Object[] selectionValues = null;

      List<String> choices = att.getChoices();
      if (choices != null && choices.size() != 0) {
        selectionValues = choices.toArray();
      } else if (att.getYesNo() != null && att.getYesNo() > 0) {
        selectionValues = new Object[] { "Ja", "Nei" };
      }
      String attributeValue = (String) JOptionPane.showInputDialog(window
          .getComponent(), "Gi attributt verdi", "Attributt",
          JOptionPane.PLAIN_MESSAGE, null, selectionValues, null);
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.Attribute

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.