ADVANCED INFORMATION

TECHNOLOGY SOLUTIONS _____

 

Home         Products         Services         Free Quote         Site Map          Advanced Search          Contact .

 

 Strategic Outsourcing             Scientific Solutions              Business Applications           Software Tools .

 

 Talk to a representative > .

Home
What is BeanExplorer?
Competition ?
Tour
White Paper
Installation Instructions
Support Center
BeanExplorer News
BeanInfoEditor
Property Inspector

In this section:

<<

In this sub-section:

\\

 

Sample GUI's >>>>>

Testimonial Laurent Favre, CEO, AlternativeSoft AG - http://www.alternativesoft.com/

"We have been working with [ITC Software] for more than 2 years now. We started with contract basis work and finally came to ODC which is completely dedicated for our tasks. High team stability, good proficiency and efficient administration support are the factors which bring high value to our collaboration."  ..../more

 

TED Ideas worth spreading.

Inspired talks by the
world's greatest
thinkers and doers >>

 

Climate Change >


> Decision Theory
 

 

  White Paper


   BeanInfoEditor ] [ Property Inspector ]
 

The Property Inspector is a essential part of modern IDE and application builder tools becoming a common unit of professional user interfaces. Such an approach significantly (if not completely) reduces the number of dialogs in an application, making the application user interface modern and consistent.

From the development perspective the usage of the Property Inspector greatly minimizes the time of development and code size. All you need to do is write the beans responsible for the application logic and possibly some custom editors.

 

Basic concepts

Property Inspector is a component designed for displaying and editing of properties of the bean. "Classic" Property Inspector consists of 2 columns: The first column displays the property names; The second column displays the property values.

Property Inspector exploring BarChart bean.

By type of its value properties are divided into three groups:

  • Simple properties  - as a rule value type of simple property is the String or simple Java type: boolean, byte, char, short, int, long, float or double. In the picture above title, orientation and autoLayout are examples of simple properties.

  • Array properties - value of such property is an array. The simple or composite property is associated with each array item value. In the picture above columns are  array property, and the composite property is associated with each array item.

  • Composite properties. The value of the composite property is another bean, characterized by its own set of properties.

Hierarchy of the properties

Bean properties can form a hierarchy, represented in Property Inspector as a tree. In the example above BarChart bean has array property columns. Array items presented by composite properties consisting from 4 simple properties: label, value, color and visible.

Property editors

Property editor is used to display and edit the value of the property. For each value type a specialized editor is required.

BeanExplorer comes pre-equipped with editors for all simple Java types (boolean, byte, char, short, int, long, float and double), as well as for more frequently used types like String, Dimension, Color and Font (see the picture above).

Embedding Property Inspector into your application

Property Inspector itself is a bean that can be easily embedded in any Java application. The example below demonstrates a sample application (see the complete code given below). The left pane contains a bean (BarChart), the right pane contains Property Inspector that manipulates properties of the bean.


In simple scenarios to embed Property Inspector into your application you need only four lines of code:

  1. Specify a class to import

    import com.beanexplorer.swing.PropertyInspector;

  2. Create instance of Property Inspector

    PropertyInspector propertyInspector = new PropertyInspector();

  3. Set up the bean to be explored in Property Inspector

    propertyInspector.explore(bean);

  4. Insert PropertyInspector into application frame or panel

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
                                          bean, propertyInspector);

To compile and run the application add beanhelpers.jar and beanexplorer.jar into application classpath

java -classpath .;beanhelpers.jar;beanexplorer.jar SampleApplication

 

Sample application code


import com.beanexplorer.swing.PropertyInspector;

import barchart.*;

import java.awt.*
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class SampleApplication extends JFrame
{
    public SampleApplication()
    {
        super("Bean Explorer Sample Application");

        // initialise the bean
        Column[] columns = {new Column("Q1", 5,  Color.blue),
                            new Column("Q2", 8,  Color.red),
                            new Column("Q3", 10, Color.magenta),
                            new Column("Q4", 7,  Color.pink)};
        BarChart bean = new BarChart("Quarter report", columns);

        // initialize property inspector
        PropertyInspector propertyInspector = new PropertyInspector();

        // explore the bean
        propertyInspector.explore(bean);

        // insert bean and PropertyInspector into application frame
        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                                              bean, propertyInspector);
        getContentPane().add(splitPane, BorderLayout.CENTER);
    }

    static public void main(String[] args)
    {
        SimpleApplication app = new SimpleApplication();
        app.setSize(new Dimension(400, 300));
        app.pack();
    }
}


[What is BeanExplorer?] [Competition ?] [Tour] [White Paper] [Installation Instructions] [Support Center] [BeanExplorer News]
BeanInfoEditor ] [ Property Inspector ]

 
Home    Site Map    FREE Quote    Advanced Search     About us      Meet the Team      Legal    Investors   Contact

© 2002-2008  ITC Software. All rights reserved. This site was last updated on 09/06/2008

Product and company names mentioned herein may be trademarks of their respective owners. info(at)itcsoftware.com
      

web metrics
 


Recommend this page: