Commit [r78] Maximize Restore History

version 0.91 changes

bruce_a_martin 2012-10-13

1 2 3 .. 6 > >> (Page 1 of 6)
added /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/ITableColoringAgent.java
removed /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/Combo/ComboObjOption.java
removed /Source/RecordEditor/src/net/sf/RecordEditor/re/file/filter/FilterGroupDetails.java
removed /Source/RecordEditor/src/net/sf/RecordEditor/edit/display/util/SaveAsNew.java
changed /Source/JRecord/src/net/sf/JRecord/Details/BasicLine.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/re/file/filter/FilterPnl2.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/edit/display/util/BaseFieldSelection.java
changed /Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/FieldSelect.java
changed /Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/tip/def/TipLayoutMgr.java
changed /Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/PoMessageLineReader.java
changed /Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/OrSelection.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/re/jrecord/types/RecordFormats.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/re/util/UpgradeDB.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/edit/display/BaseDisplay.java
changed /Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/RecordSel.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/SwingUtils.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/re/file/FileView.java
changed /Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/def/PoField.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/edit/util/ReMessages.java
changed /Source/RecordEditor/src/net/sf/RecordEditor/jibx/compare/Record.java
changed /Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/display/PoDisplayBuilder.java
changed /Source/RecordEditor/src/diffXmlBindings.xml
copied /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/SaveButton.java -> /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/treeCombo/ComboLikeObject.java
/Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/ITableColoringAgent.java Diff Switch to side-by-side view
Loading...
/Source/JRecord/src/net/sf/JRecord/Details/BasicLine.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/re/file/filter/FilterPnl2.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/edit/display/util/BaseFieldSelection.java Diff Switch to side-by-side view
Loading...
/Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/FieldSelect.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/tip/def/TipLayoutMgr.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/PoMessageLineReader.java Diff Switch to side-by-side view
Loading...
/Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/OrSelection.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/re/jrecord/types/RecordFormats.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/re/util/UpgradeDB.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/edit/display/BaseDisplay.java Diff Switch to side-by-side view
Loading...
/Source/JRecord_Common/src/net/sf/JRecord/detailsSelection/RecordSel.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/SwingUtils.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/re/file/FileView.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/def/PoField.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/edit/util/ReMessages.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/jibx/compare/Record.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor_GetText_Po/src/net/sf/RecordEditor/po/display/PoDisplayBuilder.java Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/diffXmlBindings.xml Diff Switch to side-by-side view
Loading...
/Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/SaveButton.java to /Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/treeCombo/ComboLikeObject.java
--- a/Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/SaveButton.java
+++ b/Source/RecordEditor/src/net/sf/RecordEditor/utils/swing/treeCombo/ComboLikeObject.java
@@ -1,64 +1,101 @@
-package net.sf.RecordEditor.utils.swing;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JButton;
-
-import net.sf.RecordEditor.utils.common.AbstractSaveDetails;
-import net.sf.RecordEditor.utils.common.Common;
-import net.sf.RecordEditor.utils.lang.LangConversion;
-
-
-@SuppressWarnings("serial")
-public class SaveButton<what> extends JButton implements ActionListener {
-
-
-	private AbstractSaveDetails<what> saveCallBack;
-	private String dir;
-
-	private DirectoryFrame saveFrame= null;
-
-
-	public SaveButton(AbstractSaveDetails<what> save, String directory) {
-		super(LangConversion.convert(LangConversion.ST_BUTTON, "Save"), Common.getRecordIcon(Common.ID_SAVE_ICON));
-
-		saveCallBack = save;
-		dir = directory;
-
-		this.addActionListener(this);
-	}
-
-
-	/**
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	@Override
-	public void actionPerformed(ActionEvent e) {
-
-		if (e.getSource() == this) {
-			ap_InitFrame();
-		} else {
-			what saveDetails = saveCallBack.getSaveDetails();
-			try {
-				(new net.sf.RecordEditor.jibx.JibxCall<what>(saveDetails.getClass()))
-						.unmarshal(saveFrame.getFileName(), saveDetails);
-				saveFrame.setVisible(false);
-				saveFrame = null;
-			} catch (Exception ex) {
-				ex.printStackTrace();
-				Common.logMsg("jibx- Save to Xml failed:", ex);
-			}
-		}
-	}
-
-	private void ap_InitFrame() {
-		if (saveFrame == null) {
-			saveFrame = new DirectoryFrame("Save to Xml",  dir, false, false, true);
-
-			saveFrame.setActionListner(this);
-		}
-
-		saveFrame.setVisible(true);
-	}
-}
+package net.sf.RecordEditor.utils.swing.treeCombo;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JTextField;
+import javax.swing.text.JTextComponent;
+
+import com.zbluesoftware.java.bm.ArrowButton;
+
+@SuppressWarnings("serial")
+public class ComboLikeObject extends JPanel implements ActionListener {
+
+	private static final int FIELD_WIDTH = 20;
+
+	private final JTextComponent valueTxt = new JTextField();
+	protected final JButton btn = new ArrowButton(ArrowButton.SOUTH);
+
+	protected boolean visible = false;
+	private JPopupMenu currentPopup;
+
+	public ComboLikeObject() {
+		this(new JPopupMenu());
+	}
+
+	public ComboLikeObject(JPopupMenu popup) {
+		super();
+
+		valueTxt.setOpaque(true);
+		currentPopup = popup;
+		init();
+	}
+
+	protected void init() {
+
+		valueTxt.setMinimumSize(new Dimension(FIELD_WIDTH, valueTxt.getHeight()));
+
+		this.setLayout(new BorderLayout());
+		this.add(BorderLayout.CENTER, valueTxt);
+		this.add(BorderLayout.EAST, btn);
+
+		this.setBorder(valueTxt.getBorder());
+		valueTxt.setBorder(BorderFactory.createEmptyBorder());
+		btn.addActionListener(this);
+	}
+
+	/**
+	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+	 */
+	public void actionPerformed(ActionEvent e) {
+
+        if (visible) {
+        	currentPopup.setVisible(false);
+        } else {
+        	currentPopup = getPopup();
+         	if (currentPopup != null) {
+        		int xCoord = 0;
+        		int yCoord = valueTxt.getHeight();
+
+        		currentPopup.show(valueTxt, xCoord, yCoord);
+        		if (currentPopup.getWidth() < this.getWidth()) {
+        			currentPopup.setPopupSize(new Dimension(this.getWidth(), currentPopup.getHeight()));
+        		}
+         	}
+	    }
+	    visible = ! visible;
+	}
+
+	/**
+	 * @return the currentPopup
+	 */
+	public JPopupMenu getCurrentPopup() {
+		return currentPopup;
+	}
+
+	public JPopupMenu getPopup() {
+		return currentPopup;
+	}
+
+	/**
+	 * @param t
+	 * @see javax.swing.text.JTextComponent#setText(java.lang.String)
+	 */
+	public void setText(String t) {
+		valueTxt.setText(t);
+	}
+
+	/**
+	 * @return
+	 * @see javax.swing.text.JTextComponent#getText()
+	 */
+	public String getText() {
+		return valueTxt.getText();
+	}
+}
1 2 3 .. 6 > >> (Page 1 of 6)