Search in sources :

Example 6 with BOMWrapper

use of org.eevolution.model.wrapper.BOMWrapper in project adempiere by adempiere.

the class BOMTreeFactory method getTreeNodeRepresentation.

protected String getTreeNodeRepresentation(DefaultMutableTreeNode node) {
    String name = null;
    if (node.getUserObject() instanceof MProduct) {
        MProduct p = (MProduct) node.getUserObject();
        name = p.getName() + " (" + p.getValue() + ")";
    }
    if (node.getUserObject() instanceof MPPOrder) {
        MPPOrder o = (MPPOrder) node.getUserObject();
        MResource r = MResource.get(Env.getCtx(), o.getS_Resource_ID());
        name = o.getDocumentNo() + " (" + r.getName() + ")";
    } else if (node.getUserObject() instanceof BOMWrapper) {
        BOMWrapper pb = (BOMWrapper) node.getUserObject();
        MProduct p = new MProduct(Env.getCtx(), pb.getM_Product_ID(), null);
        name = pb.getName();
    } else if (node.getUserObject() instanceof BOMLineWrapper) {
        BOMLineWrapper mpbl = (BOMLineWrapper) node.getUserObject();
        MProduct p = new MProduct(Env.getCtx(), mpbl.getM_Product_ID(), null);
        name = p.getName();
    }
    return name;
}
Also used : MResource(org.compiere.model.MResource) MProduct(org.compiere.model.MProduct) BOMWrapper(org.eevolution.model.wrapper.BOMWrapper) MPPOrder(org.eevolution.model.MPPOrder) BOMLineWrapper(org.eevolution.model.wrapper.BOMLineWrapper)

Example 7 with BOMWrapper

use of org.eevolution.model.wrapper.BOMWrapper in project adempiere by adempiere.

the class BOMMessenger method getToolTipText.

public String getToolTipText(TreePath path) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
    String tooltip = (String) cache.get(node);
    if (tooltip != null) {
        return tooltip;
    }
    if (node.getUserObject() instanceof MProduct) {
        tooltip = getProductInfo((MProduct) node.getUserObject());
    }
    if (node.getUserObject() instanceof MPPOrder) {
        tooltip = getMfcOrderInfo((MPPOrder) node.getUserObject());
    } else if (node.getUserObject() instanceof BOMWrapper) {
        tooltip = getBOMInfo((BOMWrapper) node.getUserObject());
    } else if (node.getUserObject() instanceof BOMLineWrapper) {
        tooltip = getBOMLineInfo((BOMLineWrapper) node.getUserObject());
    }
    cache.put(node, tooltip);
    return tooltip;
}
Also used : MProduct(org.compiere.model.MProduct) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) BOMWrapper(org.eevolution.model.wrapper.BOMWrapper) MPPOrder(org.eevolution.model.MPPOrder) BOMLineWrapper(org.eevolution.model.wrapper.BOMLineWrapper)

Example 8 with BOMWrapper

use of org.eevolution.model.wrapper.BOMWrapper in project adempiere by adempiere.

the class DeleteBOMAction method delete.

private void delete(DefaultMutableTreeNode node) {
    if (node.getUserObject() instanceof BOMWrapper) {
        BOMWrapper bom = (BOMWrapper) node.getUserObject();
        for (int i = 0; i < node.getChildCount(); i++) {
            delete((DefaultMutableTreeNode) node.getChildAt(i));
            if (!successful()) {
                break;
            }
        }
        deletePO(bom.get());
    } else {
        BOMLineWrapper line = (BOMLineWrapper) node.getUserObject();
        deletePO(line.get());
    }
}
Also used : BOMWrapper(org.eevolution.model.wrapper.BOMWrapper) BOMLineWrapper(org.eevolution.model.wrapper.BOMLineWrapper)

Aggregations

BOMWrapper (org.eevolution.model.wrapper.BOMWrapper)8 MPPOrder (org.eevolution.model.MPPOrder)5 MProduct (org.compiere.model.MProduct)4 BOMLineWrapper (org.eevolution.model.wrapper.BOMLineWrapper)4 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)3 MResource (org.compiere.model.MResource)2 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1 MRfQ (org.compiere.model.MRfQ)1 MPPProductBOM (org.eevolution.model.MPPProductBOM)1