src/share/classes/sun/awt/shell/ShellFolderColumnInfo.java

Print this page
rev 9717 : 8039642: Fix raw and unchecked warnings in sun.awt.*
Reviewed-by:


  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt.shell;
  27 
  28 import javax.swing.*;
  29 import java.util.Comparator;
  30 
  31 public class ShellFolderColumnInfo {
  32     private String title;
  33     private Integer width;
  34     private boolean visible;
  35     /**
  36      * Allowed values are {@link SwingConstants#LEFT}, {@link SwingConstants#RIGHT}, {@link SwingConstants#LEADING},
  37      * {@link SwingConstants#TRAILING}, {@link SwingConstants#CENTER}
  38      */
  39     private Integer alignment;
  40     private SortOrder sortOrder;
  41     private Comparator comparator;
  42     /**
  43      * <code>false</code> (default) if the {@link comparator} expects folders as arguments,
  44      * and <code>true</code> if folder's column values. The first option is used default for comparison
  45      * on Windows and also for separating files from directories when sorting using
  46      * ShellFolderManager's inner comparator.
  47      */
  48     private boolean compareByColumn;
  49 
  50     public ShellFolderColumnInfo(String title, Integer width,
  51                                  Integer alignment, boolean visible,
  52                                  SortOrder sortOrder, Comparator comparator,
  53                                  boolean compareByColumn) {
  54         this.title = title;
  55         this.width = width;
  56         this.alignment = alignment;
  57         this.visible = visible;
  58         this.sortOrder = sortOrder;
  59         this.comparator = comparator;
  60         this.compareByColumn = compareByColumn;
  61     }
  62 
  63     public ShellFolderColumnInfo(String title, Integer width,
  64                                  Integer alignment, boolean visible,
  65                                  SortOrder sortOrder, Comparator comparator) {
  66         this(title, width, alignment, visible, sortOrder, comparator, false);
  67     }
  68 
  69     /**
  70      * This constructor is used by native code when getting column set for
  71      * a folder under Windows
  72      */
  73     public ShellFolderColumnInfo(String title, int width, int alignment,
  74                                  boolean visible) {
  75         this(title, width, alignment, visible, null, null);
  76     }
  77 
  78     public String getTitle() {
  79         return title;
  80     }
  81 
  82     public void setTitle(String title) {
  83         this.title = title;
  84     }
  85 


  98     public void setAlignment(Integer alignment) {
  99         this.alignment = alignment;
 100     }
 101 
 102     public boolean isVisible() {
 103         return visible;
 104     }
 105 
 106     public void setVisible(boolean visible) {
 107         this.visible = visible;
 108     }
 109 
 110     public SortOrder getSortOrder() {
 111         return sortOrder;
 112     }
 113 
 114     public void setSortOrder(SortOrder sortOrder) {
 115         this.sortOrder = sortOrder;
 116     }
 117 
 118     public Comparator getComparator() {
 119         return comparator;
 120     }
 121 
 122     public void setComparator(Comparator comparator) {
 123         this.comparator = comparator;
 124     }
 125 
 126     public boolean isCompareByColumn() {
 127         return compareByColumn;
 128     }
 129 
 130     public void setCompareByColumn(boolean compareByColumn) {
 131         this.compareByColumn = compareByColumn;
 132     }
 133 }


  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt.shell;
  27 
  28 import javax.swing.*;
  29 import java.util.Comparator;
  30 
  31 public class ShellFolderColumnInfo {
  32     private String title;
  33     private Integer width;
  34     private boolean visible;
  35     /**
  36      * Allowed values are {@link SwingConstants#LEFT}, {@link SwingConstants#RIGHT}, {@link SwingConstants#LEADING},
  37      * {@link SwingConstants#TRAILING}, {@link SwingConstants#CENTER}
  38      */
  39     private Integer alignment;
  40     private SortOrder sortOrder;
  41     private Comparator<?> comparator;
  42     /**
  43      * <code>false</code> (default) if the {@link comparator} expects folders as arguments,
  44      * and <code>true</code> if folder's column values. The first option is used default for comparison
  45      * on Windows and also for separating files from directories when sorting using
  46      * ShellFolderManager's inner comparator.
  47      */
  48     private boolean compareByColumn;
  49 
  50     public ShellFolderColumnInfo(String title, Integer width,
  51                                  Integer alignment, boolean visible,
  52                                  SortOrder sortOrder, Comparator<?> comparator,
  53                                  boolean compareByColumn) {
  54         this.title = title;
  55         this.width = width;
  56         this.alignment = alignment;
  57         this.visible = visible;
  58         this.sortOrder = sortOrder;
  59         this.comparator = comparator;
  60         this.compareByColumn = compareByColumn;
  61     }
  62 
  63     public ShellFolderColumnInfo(String title, Integer width,
  64                                  Integer alignment, boolean visible,
  65                                  SortOrder sortOrder, Comparator<?> comparator) {
  66         this(title, width, alignment, visible, sortOrder, comparator, false);
  67     }
  68 
  69     /**
  70      * This constructor is used by native code when getting column set for
  71      * a folder under Windows
  72      */
  73     public ShellFolderColumnInfo(String title, int width, int alignment,
  74                                  boolean visible) {
  75         this(title, width, alignment, visible, null, null);
  76     }
  77 
  78     public String getTitle() {
  79         return title;
  80     }
  81 
  82     public void setTitle(String title) {
  83         this.title = title;
  84     }
  85 


  98     public void setAlignment(Integer alignment) {
  99         this.alignment = alignment;
 100     }
 101 
 102     public boolean isVisible() {
 103         return visible;
 104     }
 105 
 106     public void setVisible(boolean visible) {
 107         this.visible = visible;
 108     }
 109 
 110     public SortOrder getSortOrder() {
 111         return sortOrder;
 112     }
 113 
 114     public void setSortOrder(SortOrder sortOrder) {
 115         this.sortOrder = sortOrder;
 116     }
 117 
 118     public Comparator<?> getComparator() {
 119         return comparator;
 120     }
 121 
 122     public void setComparator(Comparator<?> comparator) {
 123         this.comparator = comparator;
 124     }
 125 
 126     public boolean isCompareByColumn() {
 127         return compareByColumn;
 128     }
 129 
 130     public void setCompareByColumn(boolean compareByColumn) {
 131         this.compareByColumn = compareByColumn;
 132     }
 133 }