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 55731 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), 17.36 KB, created by
Oleksandr Alesinskyy
on 2006-12-14 19:27:58 EST
(
hide
)
Description:
Offending Java file
Filename:
MIME Type:
Creator:
Oleksandr Alesinskyy
Created:
2006-12-14 19:27:58 EST
Size:
17.36 KB
patch
obsolete
>package de.ntec.dehn.cd2; > >import static de.ntec.dehn.cd2.Const.*; > >import java.util.ArrayList; >import java.util.HashMap; >import java.util.List; >import java.util.Map; > >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; > private Map<String,Boolean> fArticleMap= new HashMap<String, Boolean>(); > private CheckDigitDialog fCheckDigitDialog= new CheckDigitDialog(); > > // ----------------- Initializer and Constructors ------------------ > public WareToMarkt(final DehnDao dao) { > fDao = dao; > fLog.info("WareToMarkt created"); > } > > // ----------------- Methods -------------------------------------- > public void start(String terminal) { > 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_WIDTH*2,TF_HEIGHT); > tfNve.setEditMask(MASK_NVE); > childrenPnOrder.add(tfNve); > final Button btOrder= TWUtils.getGoButton(); > TWUtils.putToRight(btOrder,tfNve,SPACING); > childrenPnOrder.add(btOrder); > final GridBox gbCollectiveOrder= new GridBox(); > TWUtils.putToRight(gbCollectiveOrder,btOrder,SPACING,TF_WIDTH+TF_WIDTH/3,TF_HEIGHT*4); > gbCollectiveOrder.setVisibleHeader(false); > final Column colCollectiveOrder= new Column(); > gbCollectiveOrder.getColumns().add(colCollectiveOrder); > gbCollectiveOrder.setEnabled(false); > gbCollectiveOrder.getStyle().getBackground().setColor( > pnOrder.getStyle().getBackground().getColor()); > childrenPnOrder.add(gbCollectiveOrder); > Label lbCollectiveOrderTitle= new Label(COLLECTIVE_ORDER_ID); > lbCollectiveOrderTitle.setBounds(gbCollectiveOrder.getX(),lbNVETitle.getY(), > LABEL_WIDTH,LABEL_HEIGHT); > childrenPnOrder.add(lbCollectiveOrderTitle); > final Panel pnArticle= new Panel(); > btOrder.addActionListener(Button.ACTION_CLICK,new ActionListener(){ > public void actionPerformed(ActionEvent ev) { > if ("".equals(tfNve.getText())) { > MessageBox.confirm(SHORT_OR_EMPTY_NVE); > return; > } > Object[][] collectiveOrders= fDao.getCollectiveOrderByNve(tfNve.getText()); > if (collectiveOrders.length==0) { > MessageBox.confirm(NO_COLLECTIVE_ORDER_ASSOSIATED_WITH_NVE); > return; > } > for (Object[] order: collectiveOrders) { > gbCollectiveOrder.getRows().add(new Row(order)); > } > fArticleMap=fDao.getArticleMap(tfNve.getText()); > flipFlop(pnArticle,pnOrder); > } > }); > tfNve.addKeyPressListener(KEY_ENTER,new KeyPressListener(){ > public void keyPress(KeyPressEvent ev) { > btOrder.fireAction(Button.ACTION_CLICK); > } > }); > pnOrder.setHeight(TWUtils.getNextY(gbCollectiveOrder,MARGIN)); > frame.getChildren().add(pnOrder); > final List<Component> childrenPnArticle = pnArticle.getChildren(); > pnArticle.setBounds(0,0,frame.getWidth(),TF_HEIGHT*5); > 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,SPACING*2+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,lbDistributedTitle,SPACING,LABEL_WIDTH); > lbTotal.getStyle().getBackground().setColor(Color.LIGHTYELLOW); > childrenPnWare.add(lbDistributed); > 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(tfNve.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)); > // It is supposed that last column is check digit, so delivered value is next to last > fDistributed+=(Integer)objects[objects.length-2]; > 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 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 colChkDigit= new Column(); > colChkDigit.setName(CHECK_DIGIT); > colChkDigit.setVisible(false); > final Column colProcessed= new Column(); > colProcessed.setName("processed"); > colProcessed.setVisible(false); > gbWareToMarkets.getColumns().add(colProcessed); > TWUtils.putUnder(gbWareToMarkets,lbWareToMarkets,SPACING,TF_WIDTH*7,TF_HEIGHT*7); > 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); > childrenPnWare.add(lbAssignedQty); > 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); > 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; > } > fch > 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); > } > String article= lbArticleNo.getText(); > fDao.acceptDistribution(article,distributedWares); > fArticleMap.put(article,true); > if (isLastArticle()) { > MessageBox.confirm(Const.ORDER_FULLFILLED); > fDao.closeOrders(colCollectiveOrder); > } > } > resetPanels(); > } > public void resetPanels() { > gbWareToMarkets.getRows().clear(); > tfAssignedQty.setText(""); > tfEan.setText(""); > lbArticleNo.setText(""); > lbDistributed.setText(""); > lbTotal.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); > flipFlop(pnOrder,pnArticle); > 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 boolean isLastArticle() { > return fArticleMap.containsValue(false); > } > > 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