| 670 | |
| 671 | * Trying to initialize a resource or auto property manually: |
| 672 | * suppose one has the following: |
| 673 | {{{ |
| 674 | public Prop<JButton> button() { |
| 675 | class button extends ResourceProperty<JButton> { |
| 676 | |
| 677 | @Override |
| 678 | protected JButton create() { |
| 679 | JButton res = new JButton(); |
| 680 | return res; |
| 681 | } |
| 682 | |
| 683 | @Override |
| 684 | protected void destroy(JButton res) { |
| 685 | //nothing. |
| 686 | } |
| 687 | |
| 688 | @Override |
| 689 | protected void setup(JButton res) { |
| 690 | res.setToolTipText(toolTip().get()); |
| 691 | } |
| 692 | } |
| 693 | return getBean().makeProp(button.class); |
| 694 | } |
| 695 | |
| 696 | public RwProp<String> toolTip() { |
| 697 | return getBean().makeValueProp("toolTip", String.class); |
| 698 | } |
| 699 | }}} |
| 700 | |
| 701 | * People tend to the the following in order to initialize the prorperty: |
| 702 | {{{ |
| 703 | button().get(); |
| 704 | }}} |
| 705 | * '''This actually will do nothing. The property is automatically created and initialized when the value property containing the tool-tip is initialized!''' |