Package com.l2fprod.common.propertysheet

Examples of com.l2fprod.common.propertysheet.PropertySheetPanel$ToggleDescriptionAction


  private void init() {
    if (sheet!=null) {
      remove(sheet);
      sheet=null;
    }
    sheet=new PropertySheetPanel();
      sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
      sheet.setDescriptionVisible(true);
      sheet.setSortingCategories(true);
      sheet.setSortingProperties(true);
      sheet.setRestoreToggleStates(true);
View Full Code Here


            e.printStackTrace();
        }
    }

    private void createPropertySheet() {
        propertySheetPanel = new PropertySheetPanel();
        propertySheetPanel.setMinimumSize(new Dimension(200, 200));
        propertySheetPanel.setPreferredSize(new Dimension(200, 200));
        propertySheetPanel.setSize(new Dimension(200, 200));
        propertySheetPanel.setRendererFactory(new XSRenderFactory());
        // setup table
View Full Code Here

        level21.addSubProperty(level211);

        DefaultProperty root = new NoReadWriteProperty();
        root.setDisplayName("Root");
       
        final PropertySheetPanel sheet = new PropertySheetPanel();
    sheet.setMode( PropertySheet.VIEW_AS_FLAT_LIST );
    sheet.setProperties( new Property[] { new ColorProperty(), level0, root } );
    sheet.readFromObject( data );
    sheet.setDescriptionVisible( true );
    sheet.setSortingCategories( true );
    sheet.setSortingProperties( true );
    add( sheet, "*" );
       
    // everytime a property change, update the button with it
    PropertyChangeListener listener = new PropertyChangeListener() {
      public void propertyChange( PropertyChangeEvent evt )
      {
        Property prop = (Property) evt.getSource();
        prop.writeToObject( data );
        System.out.println( "Updated object to " + data );
      }
    };
    sheet.addPropertySheetChangeListener( listener );
       
        JButton button = new JButton(new AbstractAction("Click to setWantsExtraIndent(true)") {
          public void actionPerformed(ActionEvent e) {
            sheet.getTable().setWantsExtraIndent(!sheet.getTable().getWantsExtraIndent());
            putValue(NAME, "Click to setWantsExtraIndent(" + !sheet.getTable().getWantsExtraIndent() + ")");
          }
        });
        add(button);
  }
View Full Code Here

    try {
      beanInfo = Introspector.getBeanInfo(JButton.class);
    } catch (IntrospectionException e) {
      e.printStackTrace();
    }
    final PropertySheetPanel sheet = new PropertySheetPanel();
    sheet.setMode(PropertySheet.VIEW_AS_FLAT_LIST);
    sheet.setToolBarVisible(false);
    sheet.setDescriptionVisible(false);
    sheet.setBeanInfo(beanInfo);

    final JPanel panel = new JPanel(LookAndFeelTweaks.createBorderLayout());
    panel.add("Center", sheet);
    panel.add("East", button);

    // initialize the properties with the value from the object
    // one can use sheet.readFromObject(button)
    // but I encountered some issues with Java Web Start. The method
    // getLocationOnScreen on the button is throwing an exception, it
    // does not happen when not using Web Start. Load properties one
    // by one as follow will do the trick
    Property[] properties = sheet.getProperties();
    for (int i = 0, c = properties.length; i < c; i++) {
      try {
        properties[i].readFromObject(button);
      } catch (Exception e) {
      }
    }

    // everytime a property change, update the button with it
    PropertyChangeListener listener = new PropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent evt) {
        Property prop = (Property)evt.getSource();
        prop.writeToObject(button);
        button.repaint();
      }
    };
    sheet.addPropertySheetChangeListener(listener);

    JTextArea message = new JTextArea();
    message.setText(PropertySheetMain.RESOURCE.getString("Main.sheet2.message"));
    LookAndFeelTweaks.makeMultilineLabel(message);
    panel.add("North", message);
View Full Code Here

    data.setColor(Color.green);
    data.setPath(new File("."));
    data.setVisible(true);
    data.setTime(System.currentTimeMillis());

    final PropertySheetPanel sheet = new PropertySheetPanel();
    sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
    sheet.setDescriptionVisible(true);
    sheet.setSortingCategories(true);
    sheet.setSortingProperties(true);
    sheet.setRestoreToggleStates(true);
    add(sheet, "*");

    // everytime a property change, update the sheet with it
    new BeanBinder(data, sheet);   
  }
View Full Code Here

TOP

Related Classes of com.l2fprod.common.propertysheet.PropertySheetPanel$ToggleDescriptionAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.