From: Hirzel P. <ph...@us...> - 2008-05-18 13:06:04
|
Update of /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11115/src/org/tcotool/application Modified Files: CostCauseDetailView.java Log Message: Refactoring: adapting to CostCause Index: CostCauseDetailView.java =================================================================== RCS file: /cvsroot/tcotool/TCO-Tool/src/org/tcotool/application/CostCauseDetailView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CostCauseDetailView.java 13 Jun 2007 20:13:56 -0000 1.4 --- CostCauseDetailView.java 18 May 2008 13:06:08 -0000 1.5 *************** *** 47,52 **** private javax.swing.JLabel ivjLblDirect = null; private javax.swing.JLabel ivjLblIliCode = null; ! class IvjEventHandler implements ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { public void itemStateChanged(java.awt.event.ItemEvent e) { if (e.getSource() == CostCauseDetailView.this.getChxDirect()) --- 47,56 ---- private javax.swing.JLabel ivjLblDirect = null; private javax.swing.JLabel ivjLblIliCode = null; + private javax.swing.JCheckBox ivjChxDirect = null; + private boolean ivjConnPtoP1Aligning = false; + private ch.softenvironment.view.SimpleEditorPanel ivjPnlDocumentation = null; + private boolean ivjConnPtoP3Aligning = false; ! class IvjEventHandler implements ch.softenvironment.view.SimpleEditorPanelListener, ch.softenvironment.view.ToolBarListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.beans.PropertyChangeListener { public void itemStateChanged(java.awt.event.ItemEvent e) { if (e.getSource() == CostCauseDetailView.this.getChxDirect()) *************** *** 78,81 **** --- 82,87 ---- if (evt.getSource() == CostCauseDetailView.this.getObject() && (evt.getPropertyName().equals("direct"))) connPtoP1SetTarget(); + if (evt.getSource() == CostCauseDetailView.this.getObject() && (evt.getPropertyName().equals("documentation"))) + connPtoP3SetTarget(); }; public void tbbCopyAction_actionPerformed(java.util.EventObject newEvent) {}; *************** *** 93,99 **** }; public void tbbUndoAction_actionPerformed(java.util.EventObject newEvent) {}; }; - private javax.swing.JCheckBox ivjChxDirect = null; - private boolean ivjConnPtoP1Aligning = false; /** * Constructor --- 99,107 ---- }; public void tbbUndoAction_actionPerformed(java.util.EventObject newEvent) {}; + public void txaEditorKey_keyReleased(java.util.EventObject newEvent) { + if (newEvent.getSource() == CostCauseDetailView.this.getPnlDocumentation()) + connPtoP3SetSource(); + }; }; /** * Constructor *************** *** 309,312 **** --- 317,370 ---- } /** + * connPtoP3SetSource: (Object.documentation <--> PnlDocumentation.text) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP3SetSource() { + /* Set the source from the target */ + try { + if (ivjConnPtoP3Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP3Aligning = true; + if ((getObject() != null)) { + getObject().setDocumentation(getPnlDocumentation().getText()); + } + // user code begin {2} + // user code end + ivjConnPtoP3Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP3Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** + * connPtoP3SetTarget: (Object.documentation <--> PnlDocumentation.text) + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private void connPtoP3SetTarget() { + /* Set the target from the source */ + try { + if (ivjConnPtoP3Aligning == false) { + // user code begin {1} + // user code end + ivjConnPtoP3Aligning = true; + if ((getObject() != null)) { + getPnlDocumentation().setText(getObject().getDocumentation()); + } + // user code begin {2} + // user code end + ivjConnPtoP3Aligning = false; + } + } catch (java.lang.Throwable ivjExc) { + ivjConnPtoP3Aligning = false; + // user code begin {3} + // user code end + handleException(ivjExc); + } + } + /** * connPtoP4SetSource: (Object.producer <--> JTextField1.text) */ *************** *** 456,460 **** ivjChxDirect.setName("ChxDirect"); ivjChxDirect.setText(""); ! ivjChxDirect.setBounds(161, 22, 24, 22); // user code begin {1} // user code end --- 514,518 ---- ivjChxDirect.setName("ChxDirect"); ivjChxDirect.setText(""); ! ivjChxDirect.setBounds(162, 51, 24, 22); // user code begin {1} // user code end *************** *** 487,494 **** ivjJPanel1 = new javax.swing.JPanel(); ivjJPanel1.setName("JPanel1"); ! ivjJPanel1.setLayout(null); ! getJPanel1().add(getLblName(), getLblName().getName()); ! getJPanel1().add(getJTabbedPane1(), getJTabbedPane1().getName()); ! getJPanel1().add(getPnlName(), getPnlName().getName()); // user code begin {1} // user code end --- 545,578 ---- ivjJPanel1 = new javax.swing.JPanel(); ivjJPanel1.setName("JPanel1"); ! ivjJPanel1.setLayout(new java.awt.GridBagLayout()); ! ! java.awt.GridBagConstraints constraintsLblName = new java.awt.GridBagConstraints(); ! constraintsLblName.gridx = 1; constraintsLblName.gridy = 1; ! constraintsLblName.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsLblName.ipadx = 55; ! constraintsLblName.insets = new java.awt.Insets(16, 11, 14, 16); ! getJPanel1().add(getLblName(), constraintsLblName); ! ! java.awt.GridBagConstraints constraintsJTabbedPane1 = new java.awt.GridBagConstraints(); ! constraintsJTabbedPane1.gridx = 1; constraintsJTabbedPane1.gridy = 2; ! constraintsJTabbedPane1.gridwidth = 2; ! constraintsJTabbedPane1.fill = java.awt.GridBagConstraints.BOTH; ! constraintsJTabbedPane1.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsJTabbedPane1.weightx = 1.0; ! constraintsJTabbedPane1.weighty = 1.0; ! constraintsJTabbedPane1.ipadx = 488; ! constraintsJTabbedPane1.ipady = 92; ! constraintsJTabbedPane1.insets = new java.awt.Insets(7, 7, 19, 12); ! getJPanel1().add(getJTabbedPane1(), constraintsJTabbedPane1); ! ! java.awt.GridBagConstraints constraintsPnlName = new java.awt.GridBagConstraints(); ! constraintsPnlName.gridx = 2; constraintsPnlName.gridy = 1; ! constraintsPnlName.fill = java.awt.GridBagConstraints.HORIZONTAL; ! constraintsPnlName.anchor = java.awt.GridBagConstraints.NORTHWEST; ! constraintsPnlName.weightx = 1.0; ! constraintsPnlName.weighty = 1.0; ! constraintsPnlName.ipadx = 137; ! constraintsPnlName.insets = new java.awt.Insets(11, 16, 7, 12); ! getJPanel1().add(getPnlName(), constraintsPnlName); // user code begin {1} // user code end *************** *** 511,517 **** ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); - ivjJTabbedPane1.setBounds(7, 51, 486, 157); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 595,603 ---- ivjJTabbedPane1 = new javax.swing.JTabbedPane(); ivjJTabbedPane1.setName("JTabbedPane1"); ivjJTabbedPane1.insertTab("Detail", null, getPnlDetail(), null, 0); + ivjJTabbedPane1.insertTab("Note", null, getPnlDocumentation(), null, 1); // user code begin {1} + ivjJTabbedPane1.setTitleAt(0, ResourceManager.getResource(ServiceDetailView.class, "PnlDetail_text")); + ivjJTabbedPane1.setTitleAt(1, ResourceManager.getResource(ServiceDetailView.class, "PnlNote_text")); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 534,538 **** ivjLblDirect.setName("LblDirect"); ivjLblDirect.setText("Direkte Kosten:"); ! ivjLblDirect.setBounds(11, 25, 143, 14); // user code begin {1} ivjLblDirect.setText(getResourceString("LblDirect_text")); --- 620,624 ---- ivjLblDirect.setName("LblDirect"); ivjLblDirect.setText("Direkte Kosten:"); ! ivjLblDirect.setBounds(12, 54, 143, 14); // user code begin {1} ivjLblDirect.setText(getResourceString("LblDirect_text")); *************** *** 558,563 **** ivjLblIliCode.setName("LblIliCode"); ivjLblIliCode.setText("IliCode:"); ! ivjLblIliCode.setBounds(11, 52, 143, 14); // user code begin {1} // user code end } catch (java.lang.Throwable ivjExc) { --- 644,652 ---- ivjLblIliCode.setName("LblIliCode"); ivjLblIliCode.setText("IliCode:"); ! ivjLblIliCode.setBounds(12, 23, 143, 14); // user code begin {1} + //TODO NLS + ivjLblIliCode.setText("Nr:"); + ivjLblIliCode.setToolTipText("IliCode [UNIQUE!]"); // user code end } catch (java.lang.Throwable ivjExc) { *************** *** 580,584 **** ivjLblName.setName("LblName"); ivjLblName.setText("Bezeichnung:"); - ivjLblName.setBounds(11, 16, 131, 14); // user code begin {1} ivjLblName.setText(ResourceManager.getResource(ServiceDetailView.class, "LblName_text")); --- 669,672 ---- *************** *** 628,631 **** --- 716,739 ---- } /** + * Return the PnlDocumentation property value. + * @return ch.softenvironment.view.SimpleEditorPanel + */ + /* WARNING: THIS METHOD WILL BE REGENERATED. */ + private ch.softenvironment.view.SimpleEditorPanel getPnlDocumentation() { + if (ivjPnlDocumentation == null) { + try { + ivjPnlDocumentation = new ch.softenvironment.view.SimpleEditorPanel(); + ivjPnlDocumentation.setName("PnlDocumentation"); + // user code begin {1} + // user code end + } catch (java.lang.Throwable ivjExc) { + // user code begin {2} + // user code end + handleException(ivjExc); + } + } + return ivjPnlDocumentation; + } + /** * Return the PnlName property value. * @return ch.softenvironment.jomm.mvc.view.DbNlsStringView *************** *** 637,641 **** ivjPnlName = new ch.softenvironment.jomm.mvc.view.DbNlsStringView(); ivjPnlName.setName("PnlName"); - ivjPnlName.setBounds(149, 11, 344, 26); // user code begin {1} // user code end --- 745,748 ---- *************** *** 698,703 **** ivjTxtName1 = new javax.swing.JTextField(); ivjTxtName1.setName("TxtName1"); ! ivjTxtName1.setBounds(161, 49, 309, 20); ! ivjTxtName1.setEditable(false); // user code begin {1} // user code end --- 805,810 ---- ivjTxtName1 = new javax.swing.JTextField(); ivjTxtName1.setName("TxtName1"); ! ivjTxtName1.setBounds(162, 20, 309, 20); ! ivjTxtName1.setEditable(true); // user code begin {1} // user code end *************** *** 730,733 **** --- 837,841 ---- getTxtName1().addKeyListener(ivjEventHandler); getChxDirect().addItemListener(ivjEventHandler); + getPnlDocumentation().addSimpleEditorPanelListener(ivjEventHandler); connPtoP6SetTarget(); connPtoP2SetTarget(); *************** *** 735,738 **** --- 843,847 ---- connPtoP4SetTarget(); connPtoP1SetTarget(); + connPtoP3SetTarget(); } /** *************** *** 747,751 **** setName("CatalogueDialog"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); ! setSize(505, 305); setTitle("Kostenart"); setContentPane(getBaseDialogContentPane()); --- 856,860 ---- setName("CatalogueDialog"); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); ! setSize(534, 272); setTitle("Kostenart"); setContentPane(getBaseDialogContentPane()); *************** *** 757,760 **** --- 866,870 ---- setTitle(ModelUtility.getTypeString(CostCause.class)); setIconImage(ResourceBundle.getImageIcon(LauncherView.class, "TCO_Icon.png").getImage()); + setSize(543, 315); setConsistencyController(new ch.softenvironment.jomm.mvc.controller.ConsistencyController(this)); getPnlStandardToolbar().adaptRights(getViewOptions().getViewManager().getRights(CostCause.class)); *************** *** 844,848 **** if (((CostCause)object).getPersistencyState().isNew()) { ((CostCause)object).refresh(false); ! ((CostCause)object).setDirect(Boolean.TRUE); } --- 954,958 ---- if (((CostCause)object).getPersistencyState().isNew()) { ((CostCause)object).refresh(false); ! ((CostCause)object).setDirect(Boolean.TRUE); //default @see ModelUtility#fixModel() } *************** *** 875,878 **** --- 985,989 ---- connPtoP4SetTarget(); connPtoP1SetTarget(); + connPtoP3SetTarget(); // user code begin {1} // user code end |