Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 55582 Details for
Bug 167750
[content assist] From some point in time Eclipse crashes on code completion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Offending Java file
WareToMarkt.java (text/plain), 16.88 KB, created by
Oleksandr Alesinskyy
on 2006-12-13 08:54:27 EST
(
hide
)
Description:
Offending Java file
Filename:
MIME Type:
Creator:
Oleksandr Alesinskyy
Created:
2006-12-13 08:54:27 EST
Size:
16.88 KB
patch
obsolete
>package de.ntec.dehn.cd2; > >import static de.ntec.dehn.cd2.Const.*; > >import java.util.ArrayList; >import java.util.List; > >import org.apache.commons.logging.Log; >import org.apache.commons.logging.LogFactory; > >import de.ntec.dehn.util.TWUtils; > >import thinwire.ui.AlignX; >import thinwire.ui.Application; >import thinwire.ui.Button; >import thinwire.ui.Component; >import thinwire.ui.Container; >import thinwire.ui.Frame; >import thinwire.ui.GridBox; >import thinwire.ui.Label; >import thinwire.ui.MessageBox; >import thinwire.ui.TextField; >import thinwire.ui.GridBox.Column; >import thinwire.ui.GridBox.Row; >import thinwire.ui.event.ActionEvent; >import thinwire.ui.event.ActionListener; >import thinwire.ui.event.KeyPressEvent; >import thinwire.ui.event.KeyPressListener; >import thinwire.ui.event.PropertyChangeEvent; >import thinwire.ui.event.PropertyChangeListener; >import thinwire.ui.style.Color; >import thinwire.ui.Panel; >import thinwire.ui.ScrollType; > >public class WareToMarkt { > > // ----------------- Constants ------------------------------------ > private static final String TITLE= "Crossdocking 2 - Verteilung"; > private static final String WARE_TO_MARKETS = "Verteilung"; > private static final Log fLog= LogFactory.getLog(WareToMarkt.class); > > // ----------------- Fields --------------------------------------- > private final DehnDao fDao; > int fTotal= 0; > int fDistributed= 0; > > // ----------------- Initializer and Constructors ------------------ > public WareToMarkt(final DehnDao dao) { > fDao = dao; > fLog.info("WareToMarkt created"); > } > > // ----------------- Methods -------------------------------------- > public void start(String terminal) { > // TODO 1 Monitor Total and Distributed values (btQty, checkCompletness and so on) > final Frame frame= Application.current().getFrame(); > frame.setTitle(TITLE); > frame.setScroll(ScrollType.AS_NEEDED); > final Panel pnOrder= new Panel(); > pnOrder.setBounds(0,0,frame.getWidth(),TF_HEIGHT*5); > List<Component> childrenPnOrder= pnOrder.getChildren(); > Label lbNVETitle= new Label(NVE); > lbNVETitle.setBounds(MARGIN,MARGIN,LABEL_WIDTH,LABEL_HEIGHT); > childrenPnOrder.add(lbNVETitle); > final TextField tfNve= new TextField(); > TWUtils.putUnder(tfNve,lbNVETitle,SPACING/2,TF_HEIGHT,2*TF_WIDTH); > tfNve.setEditMask(MASK_NVE); > childrenPnOrder.add(tfNve); > final TextField tfCollectiveOrder= new TextField(); > TWUtils.putToRight(tfCollectiveOrder,tfNve,SPACING,TF_WIDTH,TF_HEIGHT); > tfCollectiveOrder.setEditMask(MASK_COLLECTIVE_ORDER); > childrenPnOrder.add(tfCollectiveOrder); > Label lbCollectiveOrderTitle= new Label(COLLECTIVE_ORDER_ID); > lbCollectiveOrderTitle.setBounds(tfCollectiveOrder.getX(),lbNVETitle.getY(), > LABEL_WIDTH,LABEL_HEIGHT); > childrenPnOrder.add(lbCollectiveOrderTitle); > Button btOrder= TWUtils.getGoButton(); > TWUtils.putToRight(btOrder,tfCollectiveOrder,SPACING); > childrenPnOrder.add(btOrder); > final Panel pnArticle= new Panel(); > btOrder.addActionListener(Button.ACTION_CLICK,new ActionListener(){ > public void actionPerformed(ActionEvent ev) { > String collectiveOrder= tfCollectiveOrder.getText(); > String collectiveOrderByNve= fDao.getCollectiveOrderByNve(tfNve.getText()); > if (collectiveOrderByNve==null) collectiveOrderByNve= collectiveOrder; > if ("".equals(collectiveOrder)) collectiveOrder= collectiveOrderByNve; > if ("".equals(collectiveOrder)) { > MessageBox.confirm(COLLECTIVE_ORDER_NOT_SPECIFIED); > return; > } > if(!collectiveOrder.equals(collectiveOrderByNve)) { > MessageBox.confirm(NVE_CONTRADICT_COLLECTIVE_ORDER); > return; > } > tfCollectiveOrder.setText(collectiveOrder); > flipFlop(pnArticle,pnOrder); > } > }); > final List<Component> childrenPnArticle = pnArticle.getChildren(); > TWUtils.putUnder(pnArticle,pnOrder,SPACING,TF_HEIGHT*5); > frame.getChildren().add(pnArticle); > final Panel pnWare= new Panel(); > final List<Component> childrenPnWare = pnWare.getChildren(); > pnWare.setEnabled(false); > final Label lbEanTitle= new Label(EAN); > lbEanTitle.setBounds(MARGIN,MARGIN,LABEL_WIDTH,LABEL_HEIGHT); > childrenPnArticle.add(lbEanTitle); > final Label lbArticleNoTitle= new Label(ARTICLE_NUMBER); > TWUtils.putToRight(lbArticleNoTitle,lbEanTitle,2*SPACING+SMALL_BUTTON_SIZE,LABEL_WIDTH); > childrenPnArticle.add(lbArticleNoTitle); > final TextField tfEan= new TextField(); > TWUtils.putUnder(tfEan,lbEanTitle,SPACING/2,TF_WIDTH,TF_HEIGHT); > tfEan.setEditMask(MASK_EAN); > childrenPnArticle.add(tfEan); > final Button btArticleNo= TWUtils.getGoButton(); > TWUtils.putToRight(btArticleNo,tfEan,SPACING); > childrenPnArticle.add(btArticleNo); > final Label lbArticleNo= new Label(); > TWUtils.putToRight(lbArticleNo,btArticleNo,SPACING,LABEL_WIDTH); > lbArticleNo.getStyle().getBackground().setColor(Color.LIGHTYELLOW); > childrenPnArticle.add(lbArticleNo); > pnArticle.setHeight(TWUtils.getNextY(btArticleNo,MARGIN)); > TWUtils.putUnder(pnWare,pnArticle,SPACING,TF_HEIGHT*15); > frame.getChildren().add(pnWare); > final Label lbWareToMarkets=new Label(WARE_TO_MARKETS); > lbWareToMarkets.setBounds(MARGIN,MARGIN,LABEL_WIDTH,LABEL_HEIGHT); > childrenPnWare.add(lbWareToMarkets); > final Label lbTotalTitle= new Label(Const.TOTAL); > TWUtils.putToRight(lbTotalTitle,lbWareToMarkets,LABEL_WIDTH,LABEL_WIDTH); > childrenPnWare.add(lbTotalTitle); > final Label lbTotal= new Label(); > TWUtils.putToRight(lbTotal,lbTotalTitle,SPACING/2,LABEL_WIDTH); > lbTotal.getStyle().getBackground().setColor(Color.LIGHTYELLOW); > childrenPnWare.add(lbTotal); > final Label lbDistributedTitle= new Label(Const.DISTRIBUTED); > TWUtils.putToRight(lbDistributedTitle,lbTotal,SPACING,LABEL_WIDTH); > childrenPnWare.add(lbDistributedTitle); > final Label lbDistributed= new Label(); > TWUtils.putToRight(lbDistributed,lbTotal,SPACING,LABEL_WIDTH); > lbTotal.getStyle().getBackground().setColor(Color.LIGHTYELLOW); > childrenPnWare.add(lbTotal); > final GridBox gbWareToMarkets= new GridBox(); > gbWareToMarkets.setVisibleHeader(true); > btArticleNo.addActionListener(Button.ACTION_CLICK, new ActionListener() { > public void actionPerformed(ActionEvent ev) { > if ("".equals(tfEan.getText())) { > MessageBox.confirm(Const.ARTICLE_NOT_SPECIFIED); > return; > } > String articleNo= fDao.getArticleByEan(tfEan.getText()); > if (articleNo==null) { > MessageBox.confirm(Const.UNKNOWN_EAN); > return; > } > lbArticleNo.setText(articleNo); > Object[][] marktsForArticle= > fDao.getMarktsForArticle(tfCollectiveOrder.getText(),articleNo); > if (marktsForArticle==null) { > MessageBox.confirm(Const.ARTICLE_NOT_IN_ORDER); > return; > } > fTotal= 0; > fDistributed= 0; > for (Object[] objects : marktsForArticle) { > gbWareToMarkets.getRows().add(new Row(objects)); > fDistributed+=(Integer)objects[objects.length-1]; > fTotal= fDistributed; > } > lbTotal.setText(String.valueOf(fTotal)); > lbDistributed.setText(String.valueOf(fDistributed)); > flipFlop(pnWare,pnArticle); > fLog.trace("btArticleNo action"); > } > }); > tfEan.addKeyPressListener(KEY_ENTER,new KeyPressListener(){ > public void keyPress(KeyPressEvent ev) { > btArticleNo.fireAction(Button.ACTION_CLICK); > } > }); > final Column colMarket= new Column(); > colMarket.setName(MARKET); > gbWareToMarkets.getColumns().add(colMarket); > final Column colPallete= new Column(); > colPallete.setName(NVE); > colPallete.setWidth(150); > gbWareToMarkets.getColumns().add(colPallete); > final Column colArea= new Column(); > colArea.setName(Const.AREA); > gbWareToMarkets.getColumns().add(colArea); > final Column colRack= new Column(); > colRack.setName(Const.RACK); > gbWareToMarkets.getColumns().add(colRack); > final Column colHori= new Column(); > colHori.setName(Const.HORIZONTAL); > colHori.setAlignX(AlignX.RIGHT); > gbWareToMarkets.getColumns().add(colHori); > final Column colVert= new Column(); > colVert.setName(Const.VERTICAL); > colVert.setAlignX(AlignX.RIGHT); > gbWareToMarkets.getColumns().add(colVert); > final Column colPlace= new Column(); > colPlace.setName(Const.PLACE); > colPlace.setAlignX(AlignX.RIGHT); > gbWareToMarkets.getColumns().add(colPlace); > final Column colOrderedQty= new Column(); > colOrderedQty.setName(ORDERED_QUANTITY); > colOrderedQty.setAlignX(AlignX.RIGHT); > gbWareToMarkets.getColumns().add(colOrderedQty); > final Column colAssignedQty= new Column(); > colAssignedQty.setName(ASSIGNED_QUANTITY); > colAssignedQty.setAlignX(AlignX.RIGHT); > gbWareToMarkets.getColumns().add(colAssignedQty); > final Column colProcessed= new Column(); > colProcessed.setName("processed"); > colProcessed.setVisible(false); > gbWareToMarkets.getColumns().add(colProcessed); > TWUtils.putUnder(gbWareToMarkets,lbWareToMarkets,SPACING,7*TF_WIDTH,7*TF_HEIGHT); > childrenPnWare.add(gbWareToMarkets); > final Label lbMarktTitle= new Label(MARKET); > TWUtils.putUnder(lbMarktTitle,gbWareToMarkets,SPACING,LABEL_WIDTH,LABEL_HEIGHT); > childrenPnWare.add(lbMarktTitle); > final Label lbAssignedQty= new Label(ASSIGNED_QUANTITY); > TWUtils.putToRight(lbAssignedQty,lbMarktTitle,SPACING,LABEL_WIDTH); > final Label lbMarkt= new Label(); > TWUtils.putUnder(lbMarkt,lbMarktTitle,SPACING/2,TF_HEIGHT); > lbMarkt.getStyle().getBackground().setColor(Color.LIGHTYELLOW); > childrenPnWare.add(lbMarkt); > final TextField tfAssignedQty= new TextField(); > TWUtils.putUnder(tfAssignedQty,lbAssignedQty,SPACING/2,TF_WIDTH,TF_HEIGHT); > tfAssignedQty.setEditMask(MASK_QTY); > tfAssignedQty.setAlignX(AlignX.RIGHT); > childrenPnWare.add(tfAssignedQty); > gbWareToMarkets.addPropertyChangeListener(Row.PROPERTY_ROW_SELECTED, > new PropertyChangeListener(){ > public void propertyChange(PropertyChangeEvent ev) { > Row row= (Row)ev.getSource(); > lbMarkt.setText(row.get(colMarket.getIndex()).toString()); > Object o= row.get(colAssignedQty.getIndex()); > if (o==null) tfAssignedQty.setText("0"); > else tfAssignedQty.setText(o.toString()); > } > }); > final Button btAssignedQty= TWUtils.getGoButton(); > TWUtils.putToRight(btAssignedQty,tfAssignedQty,SPACING); > childrenPnWare.add(btAssignedQty); > // TODO 1 Ask for check digit (DNARCHECKSUM.COMPARE(RACK,HOR,VER,PROPOSED) > btAssignedQty.addActionListener(Button.ACTION_CLICK, new ActionListener(){ > public void actionPerformed(ActionEvent ev) { > if ("".equals(tfAssignedQty.getText())) { > MessageBox.confirm(QUANTITY_NOT_SPECIFIED); > return; > } > int ind= gbWareToMarkets.getSelectedRow().getIndex(); > int newVal=Integer.parseInt(tfAssignedQty.getText()); > if (newVal>(Integer)colOrderedQty.get(ind)) { > MessageBox.confirm(OVERDELIVERY_IS_PROHIBITED); > return; > } > int distributedNewVal= fDistributed+newVal- > (colAssignedQty.get(ind)==null ? 0 : (Integer)colAssignedQty.get(ind)); > if (distributedNewVal>fTotal) { > MessageBox.confirm(Const.NOT_ENOUGH_GOODS); > return; > } > fDistributed=distributedNewVal; > lbDistributed.setText(String.valueOf(fDistributed)); > colAssignedQty.set(ind,newVal); > colProcessed.set(ind,"Y"); > markNextUnprocessed(); > } > private void markNextUnprocessed() { > GridBox.Row row= gbWareToMarkets.getSelectedRow(); > int ind= row==null ? 0 : row.getIndex(); > for (int i= ind; i<colAssignedQty.size(); i++) { > if (colProcessed.get(i)==null || "".equals(colProcessed.get(i))) { > gbWareToMarkets.getRows().get(i).setSelected(true); > return; > } > } > for (int i= 0; i<ind; i++) { > if ("".equals(colAssignedQty.get(i))) { > gbWareToMarkets.getRows().get(i).setSelected(true); > return; > } > } > } > }); > tfAssignedQty.addKeyPressListener(KEY_ENTER,new KeyPressListener() { > public void keyPress(KeyPressEvent ev) { > btAssignedQty.fireAction(Button.ACTION_CLICK); > } > }); > final Button btOk= TWUtils.getOkButton(); > TWUtils.putUnder(btOk,lbMarkt,SPACING*2,BUTTON_WIDTH,BUTTON_HEIGHT); > childrenPnWare.add(btOk); > final Button btCancel= TWUtils.getCancelButton(); > TWUtils.putToRight(btCancel,btOk,SPACING,BUTTON_WIDTH); > childrenPnWare.add(btCancel); > final ActionListener decisionHandler= new ActionListener() { > public void actionPerformed(ActionEvent ev) { > if (ev.getSource()==btOk) { > if (!checkCompletness(colProcessed)) { > MessageBox.confirm(Const.NOT_ALL_MARKTS_OR_WARES_PROCESSED); > return; > } > final List closedPalettes=new ArrayList(); > Object[][] distributedWares= new Object[3][gbWareToMarkets.getRows().size() > +closedPalettes.size()]; > for(int i=0; i<gbWareToMarkets.getRows().size();i++) { > distributedWares[0][i]= colMarket.get(i); > distributedWares[1][i]= colPallete.get(i); > distributedWares[2][i]= colAssignedQty.get(i); > } > fDao.acceptDistribution(lbArticleNo.getText(),distributedWares); > checkLastArticle(); > } > resetPanels(); > } > private void checkLastArticle() { > // TODO 0 Auto-generated method stub > // Check if article is last in Collective order and close order > } > public void resetPanels() { > gbWareToMarkets.getRows().clear(); > tfAssignedQty.setText(""); > tfEan.setText(""); > lbArticleNo.setText(""); > flipFlop(pnArticle,pnWare); > } > }; > btOk.addActionListener(Button.ACTION_CLICK,decisionHandler); > btCancel.addActionListener(Button.ACTION_CLICK,decisionHandler); > pnWare.setHeight(TWUtils.getNextY(btOk,MARGIN)); > flipFlop(pnArticle,pnWare); > frame.setVisible(true); > } > > private boolean checkCompletness(GridBox.Column colProcessed) { > if (fDistributed<fTotal) return false; > int ind= 0; > for (Object obj : colProcessed) { > if (obj==null || "".equals(obj) ) { > ((GridBox)colProcessed.getParent()).getRows().get(ind).setSelected(true); > return false; > } > ind++; > } > return true; > } > > private void flipFlop(Container<Component> c1, Container<Component> c2) { > for(Component component : c1.getChildren()) { > component.setEnabled(true); > } > c1.setEnabled(true); > for(Component component : c2.getChildren()) { > component.setEnabled(false); > } > c2.setEnabled(false); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 167750
:
55581
|
55582
|
55731
|
55732
|
55756