Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ConstructionTypeAttribute


   */
  public ConstructionTypeAttribute getArticleAttribute(Attribute attribute,
      String attributeValue, Integer dialogOrder) {
    if (attribute != null) {

      return new ConstructionTypeAttribute(null, object, attribute,
          attributeValue, null, dialogOrder);
    }
    return null;
  }
View Full Code Here


      Set<ConstructionTypeAttribute> attributes) {
    HashSet<ConstructionTypeAttribute> newAttributes = null;
    if (attributes != null) {
      newAttributes = new HashSet<ConstructionTypeAttribute>();
      for (ConstructionTypeAttribute attribute : attributes) {
        newAttributes.add(new ConstructionTypeAttribute(null,
            constructionType, attribute.getAttribute(), attribute
                .getAttributeValue(), attribute
                .getOrderLineAttributes(), attribute
                .getDialogOrder()));
      }
View Full Code Here

        .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>();
    attributes.add(att);
    constructionType.setConstructionTypeAttributes(attributes);

    manager.saveConstructionType(constructionType);
    attributes.remove(att);
    att.setConstructionType(null);
    manager.saveConstructionType(constructionType);
  }
View Full Code Here

      }
      if (attributeValue == null || attributeValue.length() == 0) {
        Util.showErrorDialog(window.getComponent(), "Feil",
            "Attributt m� ha verdi");
      } else {
        ConstructionTypeAttribute constructionTypeAttribute = constructionTypeModel
            .getArticleAttribute(newAttributes.get(0),
                attributeValue, dialogOrder);
        if (masterDialog && useAsUniversal.equalsIgnoreCase("Ja")) {
          universalAttributes.add(constructionTypeAttribute);
        }
View Full Code Here

   * @param window
   * @param presentationModel
   */
  void doEditAttribute(WindowInterface window,
      PresentationModel presentationModel) {
    ConstructionTypeAttribute attribute = (ConstructionTypeAttribute) attributeSelection
        .getSelection();

    if (attribute != null) {
      String useAsUniversal = "";
      if (masterDialog) {
        useAsUniversal = (String) JOptionPane.showInputDialog(window
            .getComponent(),
            "Skal endring gjelde alle gjeldende garasjetyper",
            "Skal gjelde alle gjelende grasjetype",
            JOptionPane.PLAIN_MESSAGE, null, new Object[] { "Ja",
                "Nei" }, null);
      }
      String attributeValue;
      if (attribute.isYesNo()) {
        attributeValue = (String) JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", "Endre verdi",
            JOptionPane.QUESTION_MESSAGE, null, new Object[] {
                "Ja", "Nei" }, attribute.getAttributeValue());
      } else if (attribute.getChoices() != null
          && attribute.getChoices().size() != 0) {

        attributeValue = (String) Util.showOptionsDialogCombo(window,
            attribute.getChoices(), "Endre verdi", true, attribute
                .getAttributeValue());

      } else {

        attributeValue = JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", attribute
            .getAttributeValue());
      }

      if (attributeValue != null) {
        String orderValue = JOptionPane.showInputDialog(window
            .getComponent(), "Rekkef�lge", attribute
            .getDialogOrder());

        if (attributeValue.length() != 0) {
          attribute.setAttributeValue(attributeValue);

        }

        if (orderValue != null && orderValue.length() != 0) {
          attribute.setDialogOrder(Integer.valueOf(orderValue));

        } else {
          attribute.setDialogOrder(null);
        }

        if (masterDialog && useAsUniversal != null
            && useAsUniversal.equalsIgnoreCase("Ja")) {
          universalChangedAttributes.add(attribute);
View Full Code Here

     * @see no.ugland.utransprod.gui.Updateable#doDelete(no.ugland.utransprod.gui.WindowInterface)
     */
    public boolean doDelete(WindowInterface window) {
      boolean deleted = true;

      ConstructionTypeAttribute attribute = (ConstructionTypeAttribute) attributeSelection
          .getSelection();

      ((ConstructionTypeManager) overviewManager)
          .lazyLoadAttribute(
              attribute,
              new LazyLoadConstructionTypeAttributeEnum[] { LazyLoadConstructionTypeAttributeEnum.ORDER_LINE_ATTRIBUTE });

      if (attribute != null) {
        if (attribute.getOrderLineAttributes() != null
            && attribute.getOrderLineAttributes().size() != 0) {
          deleted = false;
          Util
              .showErrorDialog(window, "Feil",
                  "Kan ikke slette attributt som er referert til av en ordre");
        } else {
          attributeList.remove(attribute);
          attribute.setConstructionType(null);
          presentationModel
              .setBufferedValue(
                  ConstructionTypeModel.PROPERTY_CONSTRUCTION_TYPE_ATTRIBUTES,
                  attributeList);
        }
View Full Code Here

TOP

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

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.