Ejemplo n.º 1
0
 @Override
 public Dimension getPreferredScrollableViewportSize() {
   Dimension size = super.getPreferredScrollableViewportSize();
   return size != null && size.width > 0 && size.height > 0
       ? JideSwingUtilities.adjustPreferredScrollableViewportSize(this, size)
       : size;
 }
 /*     */ public static void install(Component component, boolean onlyOnce) /*     */ {
   /*  97 */ if ((component instanceof JTextComponent)) {
     /*  98 */ if (onlyOnce) {
       /*  99 */ ((JTextComponent) component)
           .putClientProperty("SelectAll.onlyOnce", Boolean.TRUE);
       /*     */ }
     /* 101 */ component.addFocusListener(SELECT_ALL);
     /*     */ }
   /*     */ else {
     /* 104 */ JideSwingUtilities.setRecursively(
         component,
         new JideSwingUtilities.Handler(onlyOnce) {
           /*     */ public boolean condition(Component c) {
             /* 106 */ return c instanceof JTextComponent;
             /*     */ }
           /*     */
           /*     */ public void action(Component c) {
             /* 110 */ if (this.val$onlyOnce) {
               /* 111 */ ((JTextComponent) c)
                   .putClientProperty("SelectAll.onlyOnce", Boolean.TRUE);
               /*     */ }
             /* 113 */ c.addFocusListener(SelectAllUtils.SELECT_ALL);
             /*     */ }
           /*     */
           /*     */ public void postAction(Component c) /*     */ {
             /*     */ }
           /*     */ });
     /*     */ }
   /*     */ }
 /*     */ public void focusGained(FocusEvent e) {
   /*  45 */ Object object = e.getSource();
   /*  46 */ if ((object instanceof JTextComponent)) {
     /*  47 */ ((JTextComponent) object).selectAll();
     /*  48 */ Object clientProperty =
         ((JTextComponent) object).getClientProperty("SelectAll.onlyOnce");
     /*  49 */ if (Boolean.TRUE.equals(clientProperty)) {
       /*  50 */ ((JTextComponent) object).removeFocusListener(SelectAllUtils.SELECT_ALL);
       /*     */ }
     /*     */ }
   /*  53 */ else if ((object instanceof Component)) {
     /*  54 */ JideSwingUtilities.setRecursively(
         (Component) object,
         new JideSwingUtilities.Handler() {
           /*     */ public boolean condition(Component c) {
             /*  56 */ return c instanceof JTextComponent;
             /*     */ }
           /*     */
           /*     */ public void action(Component c) {
             /*  60 */ ((JTextComponent) c).selectAll();
             /*  61 */ Object clientProperty =
                 ((JTextComponent) c).getClientProperty("SelectAll.onlyOnce");
             /*  62 */ if (Boolean.TRUE.equals(clientProperty))
               /*  63 */ c.removeFocusListener(SelectAllUtils.SELECT_ALL);
             /*     */ }
           /*     */
           /*     */ public void postAction(Component c) /*     */ {
             /*     */ }
           /*     */ });
     /*     */ }
   /*     */ }
Ejemplo n.º 4
0
 /** Initialize the CheckBoxList. */
 protected void init() {
   _checkBoxListSelectionModel = createCheckBoxListSelectionModel(getModel());
   setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
   _listCellRenderer = createCellRenderer();
   _handler = createHandler();
   _checkBoxListSelectionModel.addListSelectionListener(_handler);
   JideSwingUtilities.insertMouseListener(this, _handler, 0);
   addKeyListener(_handler);
   addPropertyChangeListener("model", _handler);
   ListModel model = getModel();
   if (model != null) {
     model.addListDataListener(_handler);
   }
 }
 /*     */ public static void uninstall(Component component) /*     */ {
   /* 128 */ if ((component instanceof JTextComponent)) {
     /* 129 */ component.removeFocusListener(SELECT_ALL);
     /*     */ }
   /*     */ else
     /* 132 */ JideSwingUtilities.setRecursively(
         component,
         new JideSwingUtilities.Handler() {
           /*     */ public boolean condition(Component c) {
             /* 134 */ return c instanceof JTextComponent;
             /*     */ }
           /*     */
           /*     */ public void action(Component c) {
             /* 138 */ c.removeFocusListener(SelectAllUtils.SELECT_ALL);
             /*     */ }
           /*     */
           /*     */ public void postAction(Component c) /*     */ {
             /*     */ }
           /*     */ });
   /*     */ }
Ejemplo n.º 6
0
 @Override
 public Dimension getPreferredScrollableViewportSize() {
   return JideSwingUtilities.adjustPreferredScrollableViewportSize(
       this, super.getPreferredScrollableViewportSize());
 }