Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.ArticleTypeAttribute


    public AttributeTableModel(final ListModel listModel) {
      super(listModel, columnNames);
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
      ArticleTypeAttribute attribute = (ArticleTypeAttribute) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return attribute.getAttribute().getName();
      case 1:
        return attribute.getIsInactive();
      }
      return null;
    }
View Full Code Here


    public SetAttributeInactiveAction() {
      super("Sett inaktiv");
    }

    public void actionPerformed(ActionEvent e) {
      final ArticleTypeAttribute attribute = getSelectedAttribute();
      attribute.setInactive(1);
      bufferedAttributes.setValue(attributeList);
      tableAttributes.repaint();
    }
View Full Code Here

    public SetAttributeActiveAction() {
      super("Sett aktiv");
    }

    public void actionPerformed(ActionEvent e) {
      final ArticleTypeAttribute attribute = getSelectedAttribute();
      attribute.setInactive(0);
      bufferedAttributes.setValue(attributeList);
      tableAttributes.repaint();
    }
View Full Code Here

    }

  }

  private ArticleTypeAttribute getSelectedAttribute() {
    final ArticleTypeAttribute attribute = (ArticleTypeAttribute) attributeSelection
        .getSelection();
    return attribute;
  }
View Full Code Here

  void updateEnablement() {
    buttonRemoveAttribute.setEnabled(false);

    if (hasWriteAccess()) {
      if (attributeSelection.hasSelection()) {
        ArticleTypeAttribute attribute = (ArticleTypeAttribute) attributeSelection
            .getSelection();
        if (attribute.getAttributeFormula() != null) {
          labelFormula.setText(attribute.getAttributeFormula());
        } else {
          labelFormula.setText("");
        }

        buttonRemoveAttribute.setEnabled(true);
        if (attribute.getIsInactive()) {
          buttonSetAttributeActive.setEnabled(true);
          buttonSetAttributeInactive.setEnabled(false);
        } else {
          buttonSetAttributeActive.setEnabled(false);
          buttonSetAttributeInactive.setEnabled(true);
View Full Code Here

    /**
     * @see no.ugland.utransprod.gui.Updateable#doDelete(no.ugland.utransprod.gui.WindowInterface)
     */
    public boolean doDelete(WindowInterface window) {
      boolean deleted = true;
      final ArticleTypeAttribute attribute = getSelectedAttribute();
      managerRepository.getArticleTypeAttributeManager().lazyLoad(
          attribute,
          new LazyLoadEnum[][] { {
              LazyLoadEnum.CONSTRUCTION_TYPE_ARTICLE_ATTRIBUTES,
              LazyLoadEnum.NONE } });

      if (attribute.getConstructionTypeArticleAttributes() != null
          && attribute.getConstructionTypeArticleAttributes().size() != 0) {
        deleted = false;
        Util
            .showErrorDialog(window, "Feil",
                "Kan ikke slette attributt som er referert til av an garasjetype eller master");
      } else {
View Full Code Here

        if (attributes != null) {
            ArrayListModel oldAttributes = getArticleTypeAttributes();
            if (oldAttributes == null) {
                oldAttributes = new ArrayListModel();
            }
            ArticleTypeAttribute articleTypeAttribute;
            for (Attribute attribute : attributes) {
                articleTypeAttribute = new ArticleTypeAttribute(null, object,
                        attribute, null, null);
                oldAttributes.add(articleTypeAttribute);
            }
            setArticleTypeAttributes(oldAttributes);
        }
View Full Code Here

            List<Attribute> attributes) {
        ArrayListModel tmpArticleTypeAttributes = new ArrayListModel();
        if (attributes != null) {

            for (Attribute attribute : attributes) {
                tmpArticleTypeAttributes.add(new ArticleTypeAttribute(null,
                        object, attribute, null, null));
            }
        }
        return tmpArticleTypeAttributes;
    }
View Full Code Here

   
    OrderLine orderLine = new OrderLine();
    orderLine.setArticlePath("Garasjetype");
   
    ConstructionTypeArticleAttribute constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    ArticleTypeAttribute articleTypeAttribute=new ArticleTypeAttribute();
    Attribute attribute=new Attribute();
    attribute.setName("Veggh�yde");
    articleTypeAttribute.setAttribute(attribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    OrderLineAttribute orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Murh�yde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Bredde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Lengde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
View Full Code Here

                .findAllConstructionTypeAttributes();
        if (attributes != null && attributes.size() != 0) {
            article = new ArticleType();
            Set<ArticleTypeAttribute> constructionTypeAttributes = new HashSet<ArticleTypeAttribute>();
            article.setArticleTypeName("Garasjetype");
            ArticleTypeAttribute articleTypeAttribute;
            for (Attribute attribute : attributes) {
                articleTypeAttribute = new ArticleTypeAttribute();
                articleTypeAttribute.setArticleType(article);
                articleTypeAttribute.setAttribute(attribute);
                constructionTypeAttributes.add(articleTypeAttribute);
            }
            article.setArticleTypeAttributes(constructionTypeAttributes);
        }
        return article;
View Full Code Here

TOP

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

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.