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;
}
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;
}
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());
}
}
Aggregations