01: package net.ar.webonswing.tutorial;
02:
03: import javax.swing.*;
04:
05: import net.ar.webonswing.managers.persistence.*;
06: import net.ar.webonswing.ui.*;
07:
08: public class LabelPersistenceContributor extends LabelUIContributor {
09: public void doPersistenceContribution(
10: PersistenceContributionContainer aPersistenceManager) {
11: JLabel label = (JLabel) getJComponent();
12: aPersistenceManager.persistValue(theComponent, label.getText());
13: }
14:
15: public void restorePersistedValue(
16: PersistenceContributionContainer aPersistenceManager) {
17: JLabel label = (JLabel) getJComponent();
18: label.setText((String) aPersistenceManager
19: .restoreValue(theComponent));
20: }
21: }
|