Skip to content

Instantly share code, notes, and snippets.

@andyscott
Created May 27, 2011 18:32
Show Gist options
  • Save andyscott/995863 to your computer and use it in GitHub Desktop.
Save andyscott/995863 to your computer and use it in GitHub Desktop.
Diff for cleanups on dialog and comparator packages
Index: src/com/jidesoft/comparator/AlphanumComparator.java
===================================================================
--- src/com/jidesoft/comparator/AlphanumComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/AlphanumComparator.java (working copy)
@@ -61,7 +61,6 @@ public class AlphanumComparator implements Comparator<CharSequence> {
/**
* Length of string is passed in for improved efficiency (only need to calculate it once) *
*/
- @SuppressWarnings({"JavaDoc"})
private String getChunk(CharSequence s, int slength, int marker) {
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
Index: src/com/jidesoft/comparator/BooleanComparator.java
===================================================================
--- src/com/jidesoft/comparator/BooleanComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/BooleanComparator.java (working copy)
@@ -6,7 +6,7 @@ import java.util.Comparator;
* Comparator for boolean type. This is a singleton class. Call getInstance() to
* get the comparator.
*/
-public class BooleanComparator implements Comparator {
+public class BooleanComparator implements Comparator<Object> {
private static BooleanComparator singleton = null;
/**
Index: src/com/jidesoft/comparator/CalendarComparator.java
===================================================================
--- src/com/jidesoft/comparator/CalendarComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/CalendarComparator.java (working copy)
@@ -7,7 +7,7 @@ import java.util.Comparator;
* Comparator for Calendar type. This is a singleton class. Call getInstance() to
* get the comparator.
*/
-public class CalendarComparator implements Comparator {
+public class CalendarComparator implements Comparator<Object> {
private static CalendarComparator singleton = null;
/**
Index: src/com/jidesoft/comparator/CharSequenceComparator.java
===================================================================
--- src/com/jidesoft/comparator/CharSequenceComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/CharSequenceComparator.java (working copy)
@@ -16,7 +16,9 @@ import java.util.Comparator;
* will be treated as equal. If one is null and the other is not, the null value will be treated as smaller then
* non-null value.
*/
-public class CharSequenceComparator implements Comparator, Serializable {
+public class CharSequenceComparator implements Comparator<Object>, Serializable {
+ private static final long serialVersionUID = -4749963150099170895L;
+
private boolean _caseSensitive;
public static final ComparatorContext CONTEXT = new ComparatorContext("IgnoreLocale");
public static final ComparatorContext CONTEXT_IGNORE_CASE = new ComparatorContext("IgnoreLocale_Ignorecase");
Index: src/com/jidesoft/comparator/ComparableComparator.java
===================================================================
--- src/com/jidesoft/comparator/ComparableComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/ComparableComparator.java (working copy)
@@ -67,8 +67,9 @@ import java.util.Comparator;
* @author [email protected]
* @author JIDE Software
*/
-public class ComparableComparator implements Comparator, Serializable {
-
+public class ComparableComparator implements Comparator<Object>, Serializable {
+ private static final long serialVersionUID = -291439688585137865L;
+
private static final ComparableComparator instance =
new ComparableComparator();
@@ -82,15 +83,14 @@ public class ComparableComparator implements Comparator, Serializable {
public static ComparableComparator getInstance() {
return instance;
}
-
- private static final long serialVersionUID = -291439688585137865L;
-
+
/**
* Constructs a ComparableComparator.
*/
public ComparableComparator() {
}
+ @SuppressWarnings("unchecked")
public int compare(Object o1, Object o2) {
if (o1 == null && o2 == null) {
return 0;
@@ -107,8 +107,8 @@ public class ComparableComparator implements Comparator, Serializable {
int result1;
int result2;
try {
- result1 = ((Comparable) o1).compareTo(o2);
- result2 = ((Comparable) o2).compareTo(o1);
+ result1 = ((Comparable<Object>) o1).compareTo(o2);
+ result2 = ((Comparable<Object>) o2).compareTo(o1);
}
catch (ClassCastException e) {
return o1.getClass().getName().compareTo(o2.getClass().getName()); // fall back to compare the string
Index: src/com/jidesoft/comparator/ComparatorContext.java
===================================================================
--- src/com/jidesoft/comparator/ComparatorContext.java (revision 1765)
+++ src/com/jidesoft/comparator/ComparatorContext.java (working copy)
@@ -12,6 +12,8 @@ import com.jidesoft.converter.AbstractContext;
* compare them. This context is used so that user can register different comparators for the same type.
*/
public class ComparatorContext extends AbstractContext {
+ private static final long serialVersionUID = -4846614433415551998L;
+
/**
* Default comparator context with empty name and no user object.
*/
Index: src/com/jidesoft/comparator/DateComparator.java
===================================================================
--- src/com/jidesoft/comparator/DateComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/DateComparator.java (working copy)
@@ -12,7 +12,7 @@ import java.util.Date;
/**
* Comparator for Date type. This is a singleton class. Call getInstance() to get the comparator.
*/
-public class DateComparator implements Comparator {
+public class DateComparator implements Comparator<Object> {
private static DateComparator singleton = null;
/**
Index: src/com/jidesoft/comparator/DefaultComparator.java
===================================================================
--- src/com/jidesoft/comparator/DefaultComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/DefaultComparator.java (working copy)
@@ -6,7 +6,7 @@ import java.util.Comparator;
* Badly named, this class compares objects by first converting them to <tt>String</tt>s using the
* <tt>toString</tt> method.
*/
-public class DefaultComparator implements Comparator {
+public class DefaultComparator implements Comparator<Object> {
private static DefaultComparator singleton = null;
/**
Index: src/com/jidesoft/comparator/FastComparableComparator.java
===================================================================
--- src/com/jidesoft/comparator/FastComparableComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/FastComparableComparator.java (working copy)
@@ -19,8 +19,9 @@ import java.util.Comparator;
* @author [email protected]
* @author JIDE Software
*/
-public class FastComparableComparator implements Comparator, Serializable {
-
+public class FastComparableComparator implements Comparator<Object>, Serializable {
+ private static final long serialVersionUID = -5332640135652727575L;
+
private static final FastComparableComparator instance =
new FastComparableComparator();
@@ -41,6 +42,7 @@ public class FastComparableComparator implements Comparator, Serializable {
public FastComparableComparator() {
}
+ @SuppressWarnings("unchecked")
public int compare(Object o1, Object o2) {
if (o1 == null && o2 == null) {
return 0;
@@ -54,7 +56,7 @@ public class FastComparableComparator implements Comparator, Serializable {
if (o1 instanceof Comparable) {
if (o2 instanceof Comparable) {
- return ((Comparable) o1).compareTo(o2);
+ return ((Comparable<Object>) o1).compareTo(o2);
}
else {
// o2 wasn't comparable
Index: src/com/jidesoft/comparator/NumberComparator.java
===================================================================
--- src/com/jidesoft/comparator/NumberComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/NumberComparator.java (working copy)
@@ -5,7 +5,7 @@ import java.util.Comparator;
/**
* Comparator for Number type. This is a singleton class. Call getInstance() to get the comparator.
*/
-public class NumberComparator implements Comparator {
+public class NumberComparator implements Comparator<Object> {
/**
* Comparator Context to compare two values using the absolute value.
*/
Index: src/com/jidesoft/comparator/ObjectComparatorManager.java
===================================================================
--- src/com/jidesoft/comparator/ObjectComparatorManager.java (revision 1765)
+++ src/com/jidesoft/comparator/ObjectComparatorManager.java (working copy)
@@ -22,7 +22,7 @@ public class ObjectComparatorManager {
private static final Comparator<Object> _defaultComparator = new DefaultComparator();
- public static void registerComparator(Class<?> clazz, Comparator comparator) {
+ public static void registerComparator(Class<?> clazz, Comparator<?> comparator) {
registerComparator(clazz, comparator, ComparatorContext.DEFAULT_CONTEXT);
}
@@ -33,7 +33,7 @@ public class ObjectComparatorManager {
* @param comparator the comparator to be registered.
* @param context the comparator context.
*/
- public static void registerComparator(Class<?> clazz, Comparator comparator, ComparatorContext context) {
+ public static void registerComparator(Class<?> clazz, Comparator<?> comparator, ComparatorContext context) {
if (clazz == null) {
throw new IllegalArgumentException("Parameter clazz cannot be null");
}
@@ -92,7 +92,7 @@ public class ObjectComparatorManager {
* @param clazz the data type.
* @return the registered comparator.
*/
- public static Comparator getComparator(Class<?> clazz) {
+ public static <T> Comparator<T> getComparator(Class<T> clazz) {
return getComparator(clazz, ComparatorContext.DEFAULT_CONTEXT);
}
@@ -103,7 +103,8 @@ public class ObjectComparatorManager {
* @param context the comparator context.
* @return the comparator.
*/
- public static Comparator getComparator(Class<?> clazz, ComparatorContext context) {
+ @SuppressWarnings("unchecked")
+ public static <T> Comparator<T> getComparator(Class<T> clazz, ComparatorContext context) {
if (isAutoInit()) {
initDefaultComparator();
}
@@ -111,12 +112,12 @@ public class ObjectComparatorManager {
if (context == null) {
context = ComparatorContext.DEFAULT_CONTEXT;
}
- Comparator object = _cache.getRegisteredObject(clazz, context);
+ Comparator<?> object = _cache.getRegisteredObject(clazz, context);
if (object != null) {
- return object;
+ return (Comparator<T>) object;
}
else {
- return _defaultComparator;
+ return (Comparator<T>) _defaultComparator;
}
}
@@ -205,11 +206,12 @@ public class ObjectComparatorManager {
* @param context the comparator context
* @return the compare result as defined in {@link Comparator#compare(Object,Object)}
*/
- public static int compare(Object o1, Object o2, Class<?> clazz, ComparatorContext context) {
- Comparator comparator = getComparator(clazz, context);
+ @SuppressWarnings("unchecked")
+ public static <T> int compare(Object o1, Object o2, Class<T> clazz, ComparatorContext context) {
+ Comparator<T> comparator = getComparator(clazz, context);
if (comparator != null) {
try {
- return comparator.compare(o1, o2);
+ return comparator.compare((T)o1, (T)o2);
}
catch (Exception e) {
// ignore and let the code below handles it.
Index: src/com/jidesoft/comparator/PrioritizedObjectComparator.java
===================================================================
--- src/com/jidesoft/comparator/PrioritizedObjectComparator.java (revision 1765)
+++ src/com/jidesoft/comparator/PrioritizedObjectComparator.java (working copy)
@@ -8,8 +8,7 @@ import java.util.Comparator;
* <code>Comparator</code> for objects that implements {@link com.jidesoft.swing.Prioritized}
* interface. It is a singleton pattern. You use {@link #getInstance()} to get an instance.
*/
-@SuppressWarnings({"RawUseOfParameterizedType"})
-public class PrioritizedObjectComparator implements Comparator {
+public class PrioritizedObjectComparator implements Comparator<Object> {
private static PrioritizedObjectComparator singleton = null;
protected PrioritizedObjectComparator() {
Index: src/com/jidesoft/converter/AbstractContext.java
===================================================================
--- src/com/jidesoft/converter/AbstractContext.java (revision 1765)
+++ src/com/jidesoft/converter/AbstractContext.java (working copy)
@@ -14,6 +14,7 @@ import java.io.Serializable;
* example, in <code>ConverterContext</code>, we sometimes used it to pass in a <code>Format</code>.
*/
abstract public class AbstractContext implements Serializable {
+ private static final long serialVersionUID = -8924789128314897783L;
private String _name;
Index: src/com/jidesoft/converter/CacheMap.java
===================================================================
--- src/com/jidesoft/converter/CacheMap.java (revision 1765)
+++ src/com/jidesoft/converter/CacheMap.java (working copy)
@@ -32,6 +32,8 @@ public class CacheMap<T, K> {
}
static class Cache<K, T> extends HashMap<K, T> {
+ private static final long serialVersionUID = 7764545350468551102L;
+
public T getObject(K context) {
return get(context);
}
@@ -153,7 +155,7 @@ public class CacheMap<T, K> {
Class<?>[] interfaces = clazz.getInterfaces();
classesToSearch.addAll(Arrays.asList(interfaces));
- Class superClass = clazz;
+ Class<?> superClass = clazz;
// Direct super class, recursively
while (!superClass.isInterface()) {
superClass = superClass.getSuperclass();
@@ -256,6 +258,7 @@ public class CacheMap<T, K> {
*
* @param clazz the class
*/
+ @SuppressWarnings("unchecked")
public void remove(Class<?> clazz) {
Cache<K, T> cache = getCache(clazz);
if (cache != null) {
Index: src/com/jidesoft/converter/RegistrationEvent.java
===================================================================
--- src/com/jidesoft/converter/RegistrationEvent.java (revision 1765)
+++ src/com/jidesoft/converter/RegistrationEvent.java (working copy)
@@ -13,6 +13,8 @@ import java.util.EventObject;
* An <code>AWTEvent</code> that adds support for registration objects as the event source.
*/
public class RegistrationEvent extends EventObject {
+ private static final long serialVersionUID = 3575113313761938714L;
+
/**
* The first number in the range of IDs used for <code>DockableFrame</code> events.
*/
Index: src/com/jidesoft/dialog/AbstractDialogPage.java
===================================================================
--- src/com/jidesoft/dialog/AbstractDialogPage.java (revision 1765)
+++ src/com/jidesoft/dialog/AbstractDialogPage.java (working copy)
@@ -9,6 +9,7 @@ import java.awt.*;
* ButtonPanel. In addition, it has title, icon, description and parent attribute.
*/
public abstract class AbstractDialogPage extends AbstractPage {
+ private static final long serialVersionUID = -469903356785298291L;
protected transient ButtonEvent _buttonEvent = null;
Index: src/com/jidesoft/dialog/AbstractPage.java
===================================================================
--- src/com/jidesoft/dialog/AbstractPage.java (revision 1765)
+++ src/com/jidesoft/dialog/AbstractPage.java (working copy)
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
* so that subclass can fire {@link PageEvent} </ul>
*/
public abstract class AbstractPage extends JPanel implements Laziness {
+ private static final long serialVersionUID = 3566789990192642869L;
/**
* Used by setInvokeCondition(). This value means initialize will be called in all paint/repaint/update methods.
Index: src/com/jidesoft/dialog/BannerPanel.java
===================================================================
--- src/com/jidesoft/dialog/BannerPanel.java (revision 1765)
+++ src/com/jidesoft/dialog/BannerPanel.java (working copy)
@@ -25,6 +25,11 @@ import java.beans.PropertyChangeListener;
public class BannerPanel extends JPanel {
/**
+ *
+ */
+ private static final long serialVersionUID = -7191474275030489327L;
+
+ /**
* Title of the banner panel.
*/
protected String _title;
@@ -142,7 +147,12 @@ public class BannerPanel extends JPanel {
}
_subtitleLabel = new MultilineLabel(getSubtitle()) {
- @Override
+ /**
+ *
+ */
+ private static final long serialVersionUID = -1609681547852636926L;
+
+ @Override
public Dimension getMinimumSize() {
return new Dimension(0, 0);
}
@@ -156,7 +166,12 @@ public class BannerPanel extends JPanel {
_textPanel.add(_subtitleLabel, BorderLayout.CENTER);
_titleLabel = new JLabel(getTitle()) {
- @Override
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5832474694740336965L;
+
+ @Override
public Dimension getMinimumSize() {
return new Dimension(0, super.getMinimumSize().height);
}
Index: src/com/jidesoft/dialog/ButtonEvent.java
===================================================================
--- src/com/jidesoft/dialog/ButtonEvent.java (revision 1765)
+++ src/com/jidesoft/dialog/ButtonEvent.java (working copy)
@@ -14,6 +14,11 @@ import java.util.EventObject;
public class ButtonEvent extends EventObject {
/**
+ *
+ */
+ private static final long serialVersionUID = 392703660104570538L;
+
+ /**
* The first number in the range of IDs used for <code>ButtonEvent</code>.
*/
public static final int BUTTON_EVENT_FIRST = AWTEvent.RESERVED_ID_MAX + 1300;
Index: src/com/jidesoft/dialog/ButtonPanel.java
===================================================================
--- src/com/jidesoft/dialog/ButtonPanel.java (revision 1765)
+++ src/com/jidesoft/dialog/ButtonPanel.java (working copy)
@@ -20,6 +20,11 @@ import java.awt.*;
public class ButtonPanel extends JPanel implements ButtonListener, ButtonNames {
/**
+ *
+ */
+ private static final long serialVersionUID = -7840551457656712357L;
+
+ /**
* This option will make all buttons have the same size. If all buttons have the same size, the GUI will certainly
* look better.
*/
Index: src/com/jidesoft/dialog/ButtonPanelLayout.java
===================================================================
--- src/com/jidesoft/dialog/ButtonPanelLayout.java (revision 1765)
+++ src/com/jidesoft/dialog/ButtonPanelLayout.java (working copy)
@@ -544,7 +544,7 @@ class ButtonPanelLayout implements LayoutManager2, Serializable {
}
}
- private int layoutButtonsRightAlign(List buttons, int x, int y, Dimension alloc, boolean ltr) {
+ private int layoutButtonsRightAlign(List<Component> buttons, int x, int y, Dimension alloc, boolean ltr) {
boolean containsVisibleButton = false;
for (int i = _target.getComponentCount() - 1; i >= 0; i--) {
Component component;
Index: src/com/jidesoft/dialog/DialogPageListCellRenderer.java
===================================================================
--- src/com/jidesoft/dialog/DialogPageListCellRenderer.java (revision 1765)
+++ src/com/jidesoft/dialog/DialogPageListCellRenderer.java (working copy)
@@ -12,6 +12,11 @@ import java.awt.*;
* A list cell renderer for AbstractDialogPage.
*/
class DialogPageListCellRenderer extends DefaultListCellRenderer {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3622981818484859949L;
+
@Override
public Component getListCellRendererComponent(
JList list,
Index: src/com/jidesoft/dialog/DialogPageTreeCellRenderer.java
===================================================================
--- src/com/jidesoft/dialog/DialogPageTreeCellRenderer.java (revision 1765)
+++ src/com/jidesoft/dialog/DialogPageTreeCellRenderer.java (working copy)
@@ -18,6 +18,10 @@ import java.awt.*;
*/
public class DialogPageTreeCellRenderer extends JLabel implements TreeCellRenderer {
/**
+ *
+ */
+ private static final long serialVersionUID = 3680042627478398736L;
+ /**
* text selection color
*/
private Color _selectedForeground;
Index: src/com/jidesoft/dialog/JideOptionPane.java
===================================================================
--- src/com/jidesoft/dialog/JideOptionPane.java (revision 1765)
+++ src/com/jidesoft/dialog/JideOptionPane.java (working copy)
@@ -25,6 +25,10 @@ import java.beans.PropertyChangeListener;
* we add all necessary UIDefaults using UIDefaultCustomizer.
*/
public class JideOptionPane extends JOptionPane {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1916857052448620771L;
private Object _title;
private Object _details;
// private boolean _bannerVisible = true;
Index: src/com/jidesoft/dialog/MultiplePageDialog.java
===================================================================
--- src/com/jidesoft/dialog/MultiplePageDialog.java (revision 1765)
+++ src/com/jidesoft/dialog/MultiplePageDialog.java (working copy)
@@ -40,6 +40,11 @@ import java.util.*;
*/
public class MultiplePageDialog extends StandardDialog {
/**
+ *
+ */
+ private static final long serialVersionUID = 4915689214157425081L;
+
+ /**
* Predefined style of multiple page dialog.
*/
public static final int TAB_STYLE = 0;
@@ -986,7 +991,12 @@ public class MultiplePageDialog extends StandardDialog {
buttonsPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
final JScrollPane pane = new JScrollPane(buttonsPanel) {
- @Override
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5872376661587310320L;
+
+ @Override
public Dimension getPreferredSize() {
if (buttonsPanel.getAlignment() == SwingConstants.TOP || buttonsPanel.getAlignment() == SwingConstants.BOTTOM)
return new Dimension(buttonsPanel.getPreferredSize().width + getVerticalScrollBar().getPreferredSize().width, 5);
Index: src/com/jidesoft/dialog/MultiplePageDialogPane.java
===================================================================
--- src/com/jidesoft/dialog/MultiplePageDialogPane.java (revision 1765)
+++ src/com/jidesoft/dialog/MultiplePageDialogPane.java (working copy)
@@ -12,6 +12,7 @@ import com.jidesoft.swing.JideScrollPane;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
+
import java.awt.*;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
@@ -44,6 +45,11 @@ import java.util.*;
*/
public class MultiplePageDialogPane extends StandardDialogPane {
/**
+ *
+ */
+ private static final long serialVersionUID = -8968638943947885121L;
+
+ /**
* Predefined style of multiple page dialog.
*/
public static final int TAB_STYLE = 0;
@@ -83,7 +89,7 @@ public class MultiplePageDialogPane extends StandardDialogPane {
* Map that maps from page full title to tree node. It provides a fast access from page full title to the tree node
* in TREE_STYLE.
*/
- private Map _titleNodeMap;
+ private Map<String, MutableTreeNode> _titleNodeMap;
private JButton _okButton;
private JButton _cancelButton;
@@ -197,7 +203,12 @@ public class MultiplePageDialogPane extends StandardDialogPane {
_okButton.setAction(getOKAction());
_cancelButton.setAction(getCancelAction());
_applyButton.setAction(new AbstractAction(ButtonResources.getResourceBundle(Locale.getDefault()).getString("Button.apply")) {
- public void actionPerformed(ActionEvent e) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3413994234663396927L;
+
+ public void actionPerformed(ActionEvent e) {
if (getCurrentPage() != null) {
getCurrentPage().fireButtonEvent(ButtonEvent.DISABLE_BUTTON, APPLY);
}
@@ -398,11 +409,13 @@ public class MultiplePageDialogPane extends StandardDialogPane {
}
}
+ /*
private void dumpPagesPanel() {
for (int i = 0; i < pagesPanel.getComponentCount(); i++) {
System.out.println("" + i + ": " + pagesPanel.getComponent(i).getName());
}
}
+ */
public void contentsChanged(ListDataEvent e) {
if (e.getSource() instanceof PageList) {
@@ -522,7 +535,7 @@ public class MultiplePageDialogPane extends StandardDialogPane {
private JComponent createTreePanel() {
final DefaultMutableTreeNode root = new DefaultMutableTreeNode("", true);
- _titleNodeMap = new HashMap((int) (_pageList.getPageCount() * 0.75));
+ _titleNodeMap = new HashMap<String, MutableTreeNode>((int) (_pageList.getPageCount() * 0.75));
for (int i = 0; i < _pageList.getPageCount(); i++) {
AbstractDialogPage dialogPage = _pageList.getPage(i);
addPage(dialogPage, root, false);
@@ -540,8 +553,8 @@ public class MultiplePageDialogPane extends StandardDialogPane {
public void intervalRemoved(ListDataEvent e) {
// compare PageList with TitleNodeMap to find out what is missing
- Set set = _titleNodeMap.keySet();
- Vector toBeRemoved = new Vector();
+ Set<String> set = _titleNodeMap.keySet();
+ Vector<String> toBeRemoved = new Vector<String>();
for (Object o : set) {
String title = (String) o;
if (_pageList.getPageByFullTitle(title) == null) {
@@ -567,7 +580,7 @@ public class MultiplePageDialogPane extends StandardDialogPane {
if (_titleNodeMap != null && _pageList.getCurrentPage() != null) {
TreeNode node = (TreeNode) _titleNodeMap.get(_pageList.getCurrentPage().getFullTitle());
if (node != null) {
- ArrayList list = new ArrayList();
+ ArrayList<TreeNode> list = new ArrayList<TreeNode>();
while (node != null) {
list.add(0, node);
node = node.getParent();
@@ -715,6 +728,7 @@ public class MultiplePageDialogPane extends StandardDialogPane {
});
}
+ /*
private void removePage(AbstractDialogPage dialogPage, final DefaultMutableTreeNode root, boolean fireEvent) {
if (dialogPage == null) {
return;
@@ -748,6 +762,7 @@ public class MultiplePageDialogPane extends StandardDialogPane {
}
}
}
+ */
private JComponent createListPanel() {
final DefaultListModel listModel = new DefaultListModel();
@@ -846,7 +861,12 @@ public class MultiplePageDialogPane extends StandardDialogPane {
button.setToolTipText(optionsPanel.getDescription());
button.setEnabled(optionsPanel.isPageEnabled());
button.addActionListener(new AbstractAction() {
- public void actionPerformed(ActionEvent e) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -8913013217983540816L;
+
+ public void actionPerformed(ActionEvent e) {
setCurrentPage(optionsPanel, buttonsPanel);
if (getCurrentPage() == optionsPanel) {
group.setSelected(button.getModel(), true);
@@ -880,7 +900,12 @@ public class MultiplePageDialogPane extends StandardDialogPane {
buttonsPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
final JScrollPane pane = new JScrollPane(buttonsPanel) {
- @Override
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7258489670834946958L;
+
+ @Override
public Dimension getPreferredSize() {
if (buttonsPanel.getAlignment() == SwingConstants.TOP || buttonsPanel.getAlignment() == SwingConstants.BOTTOM)
return new Dimension(buttonsPanel.getPreferredSize().width + getVerticalScrollBar().getPreferredSize().width, 5);
@@ -945,7 +970,12 @@ public class MultiplePageDialogPane extends StandardDialogPane {
AbstractDialogPage optionsPanel = _pageList.getPage(i);
final JideButton button = createIconButton(optionsPanel.getTitle(), optionsPanel.getIcon());
button.addActionListener(new AbstractAction(optionsPanel.getTitle(), optionsPanel.getIcon()) {
- public void actionPerformed(ActionEvent e) {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2375074433514421417L;
+
+ public void actionPerformed(ActionEvent e) {
group.setSelected(button.getModel(), true);
setCurrentPage(_pageList.getPageByFullTitle(e.getActionCommand()), buttonsPanel);
}
Index: src/com/jidesoft/dialog/PageEvent.java
===================================================================
--- src/com/jidesoft/dialog/PageEvent.java (revision 1765)
+++ src/com/jidesoft/dialog/PageEvent.java (working copy)
@@ -14,6 +14,11 @@ import java.util.EventObject;
public class PageEvent extends EventObject {
/**
+ *
+ */
+ private static final long serialVersionUID = 3505923526872133295L;
+
+ /**
* The first number in the range of IDs used for <code>AbstractPage</code> events.
*/
public static final int PAGE_EVENT_FIRST = AWTEvent.RESERVED_ID_MAX + 1200;
Index: src/com/jidesoft/dialog/PageList.java
===================================================================
--- src/com/jidesoft/dialog/PageList.java (revision 1765)
+++ src/com/jidesoft/dialog/PageList.java (working copy)
@@ -16,6 +16,11 @@ import java.util.List;
*/
public class PageList extends DefaultComboBoxModel {
/**
+ *
+ */
+ private static final long serialVersionUID = 436559750018384074L;
+
+ /**
* If you know the full title of any page, use this method to get the actual page from the list.
*
* @param title the full title.
Index: src/com/jidesoft/dialog/ScrollableButtonPanel.java
===================================================================
--- src/com/jidesoft/dialog/ScrollableButtonPanel.java (revision 1765)
+++ src/com/jidesoft/dialog/ScrollableButtonPanel.java (working copy)
@@ -9,6 +9,11 @@ import java.awt.*;
*/
public class ScrollableButtonPanel extends ButtonPanel implements Scrollable {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -6329512076145429068L;
+
public ScrollableButtonPanel() {
}
Index: src/com/jidesoft/dialog/StandardDialogPane.java
===================================================================
--- src/com/jidesoft/dialog/StandardDialogPane.java (revision 1765)
+++ src/com/jidesoft/dialog/StandardDialogPane.java (working copy)
@@ -43,6 +43,10 @@ import java.awt.event.KeyEvent;
*/
abstract public class StandardDialogPane extends JPanel implements ButtonNames {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2699141371295650648L;
protected JComponent _bannerPanel;
protected JComponent _contentPanel;
protected ButtonPanel _buttonPanel;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment