From: Benjamin B. <bg...@us...> - 2005-03-18 08:02:58
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/Dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8426/Plugin/com/ibm/ecute/Dialogs Modified Files: DefinitionsTab.java ValuesTab.java EditValue.java Log Message: Index: DefinitionsTab.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/Dialogs/DefinitionsTab.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DefinitionsTab.java 27 Dec 2004 12:49:49 -0000 1.2 +++ DefinitionsTab.java 18 Mar 2005 08:02:49 -0000 1.3 @@ -220,7 +220,7 @@ JOptionPane.ERROR_MESSAGE); } - public void aceptAction(){ + public void acceptAction(){ qualifiersTable.save(qualifiersFileName); } Index: ValuesTab.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/Dialogs/ValuesTab.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ValuesTab.java 27 Dec 2004 12:49:49 -0000 1.3 +++ ValuesTab.java 18 Mar 2005 08:02:49 -0000 1.4 @@ -91,7 +91,9 @@ JButton roleB = new JButton("Role B"); JButton parentMethod = new JButton("Parent method"); public static boolean showAll = true; - public static boolean skipNext = false; + // skipNextEvent is used to ignore the next event that occurs + // among others used ignored events when returning from EditValue dialog + public /*static*/ boolean skipNextEvent = false; boolean eventsAccepted = false; boolean changes = false; boolean isModifiable = true; @@ -311,14 +313,14 @@ //it will check if there are changes to save in the current //selection before loading the new selection qualifiers public void updateWindow() { - if (skipNext) { - skipNext = false; + if (skipNextEvent) { + skipNextEvent = false; return; } if (!disableEvents()) return; if (eventsAccepted) { - skipNext = false; + skipNextEvent = false; System.out.println("Canceled"); return; } else @@ -330,9 +332,22 @@ qualifiersTable.updateData(result); } catch (Exception e) { e.printStackTrace(); + } catch (Error e){ + //e.printStackTrace(); + System.out.println("unsupported JACOB version"); + JOptionPane.showMessageDialog(this, + "You are using an unsupported version of JACOB.\n" + + "Please install one of the supported JACOB versions listed below.\n\n" + + "Supported versions:\n" + + "- JACOB 1.8\n" + + "- JACOB 1.7", + "ECUTE error", + JOptionPane.ERROR_MESSAGE); + System.exit(1); + } finally { + ComThread.Release(); + enableEvents(); } - ComThread.Release(); - enableEvents(); } public void reloadQualifiers() { try { @@ -366,7 +381,7 @@ return item; } //shows the dialog asking the user if he wants to save the changes - public boolean aceptAction(boolean ask) { + public boolean acceptAction(boolean ask) { System.out.println("acceptAction?" + changes); if (!changes) return true; @@ -475,6 +490,8 @@ } //EDIT if (e.getSource() == editButton) { + System.out.println("EditButton"); + skipNextEvent = true; if (!isModifiable) { JOptionPane .showMessageDialog( @@ -531,6 +548,8 @@ currentValueWithNull = currentValue; //if (!currentValueWithNull.equalsIgnoreCase(valueWithNull)) changes = true; + //System.out.println("currentValue = "+currentValue+ " value = "+value + // + " changes =" + changes); qualifiersTable.setValueAt(rowN, 1, value); String previousRow[] = previousRowValue(name); if (previousRow == null) { @@ -872,7 +891,7 @@ if (ID.equalsIgnoreCase(previousID)) { return null; } - if (!aceptAction(true)) + if (!acceptAction(true)) return null; } //The real update begins :-) @@ -897,7 +916,7 @@ String selectedElement = ""; Dispatch parentClass = null; switch (type) { - case 0 : + case 0 : // class parentClass = item; selectedElement = "Class: "; if (Dispatch.call(item, "IsALinkClass").toBoolean() @@ -907,7 +926,7 @@ selectedElement = "Association: "; } break; - case 1 : + case 1 : // Association if (Dispatch.get(item, "LinkClass").isNull()) { System.out.println("hola"); parentClasses.removeAllItems(); @@ -920,7 +939,7 @@ selectedElement = "Association: "; } break; - case 2 : + case 2 : // role String itemID = Dispatch.call(item, "GetUniqueId").toString(); //we have to find if its RoleA or RoleB item = Dispatch.get(item, "Association").toDispatch(); @@ -940,32 +959,31 @@ parentClass = Dispatch.get(item, "LinkClass").toDispatch(); } break; - case 3 : + case 3 : // attribute selectedElement = "Property " + itemName + ": "; parentClass = Dispatch.get(item, "ParentClass").toDispatch(); break; - case 4 : + case 4 : // operation selectedElement = "Method " + itemName + ": "; methodName = itemName; parentClass = Dispatch.get(item, "ParentClass").toDispatch(); break; - case 5 : + case 5 : // parameter selectedElement = "Parameter " + itemName + " from " + methodName + ": "; parentClass = Dispatch .call(myModel, "FindClassWithID", classID).toDispatch(); break; - case 6 : + case 6 : // category return getCategoryData(item, itemName); default : parentClasses.removeAllItems(); selected.setText(""); return new String[0][4]; } - previousTab = theTab; - System.out.println(typeS + type); + previousTab = theTab; previousTypeS = typeS; - previousType = type; + previousType = type; Dispatch category = null; if (parentClass != null) category = Dispatch.get(parentClass, "ParentCategory").toDispatch(); @@ -1855,7 +1873,7 @@ toolBarPane.add(empty); } parentFrame.show(); - skipNext = true; + skipNextEvent = true; } private String[] getHashtableKeys(Hashtable table) { Enumeration enum = table.keys(); Index: EditValue.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/Dialogs/EditValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EditValue.java 29 Nov 2004 12:46:19 -0000 1.2 +++ EditValue.java 18 Mar 2005 08:02:49 -0000 1.3 @@ -75,6 +75,7 @@ JTextArea valueText; JRadioButton trueButton; JRadioButton falseButton; + JScrollPane textPane; JCheckBox nullBox; JButton OKButton; JButton CancelButton; @@ -102,7 +103,7 @@ } }else previousValue=theValue; - + JLabel empty4=new JLabel(); mainPanelC.gridx = 0; mainPanelC.gridy = 0; @@ -116,25 +117,23 @@ mainPanelL.setConstraints( empty4, mainPanelC ); panel.add( empty4 ); - if(qualifierDef.type!=Qualifier.BOOLEAN) - { valueText = new JTextArea(theValue); - valueText.setLineWrap(true); - valueText.setWrapStyleWord(true); - JScrollPane textPane=new JScrollPane(valueText); - mainPanelC.gridx = 0; - mainPanelC.gridy = 1; - mainPanelC.gridwidth = 7; - mainPanelC.gridheight = 1; - mainPanelC.fill = GridBagConstraints.BOTH; - mainPanelC.insets=new Insets(5,5,5,5); - mainPanelC.weightx = 1; - mainPanelC.weighty = 1; - mainPanelC.anchor = GridBagConstraints.CENTER; - mainPanelL.setConstraints( textPane, mainPanelC ); - panel.add( textPane ); - - if (nullValue) - textPane.setEnabled(false); + if(qualifierDef.type!=Qualifier.BOOLEAN){ + valueText = new JTextArea(theValue); + valueText.setLineWrap(true); + valueText.setWrapStyleWord(true); + //JScrollPane textPane=new JScrollPane(valueText); + textPane = new JScrollPane(valueText); + mainPanelC.gridx = 0; + mainPanelC.gridy = 2; + mainPanelC.gridwidth = 7; + mainPanelC.gridheight = 1; + mainPanelC.fill = GridBagConstraints.BOTH; + mainPanelC.insets=new Insets(5,5,5,5); + mainPanelC.weightx = 1; + mainPanelC.weighty = 1; + mainPanelC.anchor = GridBagConstraints.CENTER; + mainPanelL.setConstraints( textPane, mainPanelC ); + panel.add( textPane ); } else // is of BOOLEAN TYPE { @@ -173,17 +172,13 @@ } - - - - nullBox=new JCheckBox("Null value",nullValue); if ((qualifierDef.type>=0)&& (qualifierDef.type!=Qualifier.BOOLEAN)) { nullBox.addItemListener(this); mainPanelC.gridx = 0; - mainPanelC.gridy = 2; + mainPanelC.gridy = 1; mainPanelC.gridwidth = 7; mainPanelC.gridheight = 1; mainPanelC.fill = GridBagConstraints.HORIZONTAL; @@ -298,6 +293,9 @@ -getHeight()/2); setLocation(thePoint); + if (nullValue) + valueText.setEnabled(false); + if (display) show(); @@ -306,6 +304,7 @@ if (nullBox.isSelected()) return null; + else return previousValue; } @@ -317,7 +316,7 @@ if(e.getActionCommand().equalsIgnoreCase("false")) valueText = new JTextArea("false"); - + if ( e.getSource() == CancelButton ) { isCancel=true; this.dispose(); @@ -353,7 +352,6 @@ falseButton.setSelected(true); } - } public void itemStateChanged(ItemEvent e) { |