25
|
1 package de.mpg.mpiwg.itgroup.digilib.digiImage.properties;
|
|
2
|
|
3 import org.eclipse.swt.events.ModifyEvent;
|
|
4 import org.eclipse.swt.events.ModifyListener;
|
|
5 import org.eclipse.swt.widgets.Text;
|
|
6 import org.eclipse.ui.views.properties.IPropertySource;
|
|
7
|
|
8 import de.mpg.mpiwg.itgroup.digilib.digiImage.DigiImage;
|
|
9
|
26
|
10 /**
|
|
11 * @author dwinter
|
|
12 *
|
|
13 * Listener on digiImage properties
|
|
14 */
|
|
15 public class DigiImagePropertyListener implements ModifyListener {
|
25
|
16
|
|
17 private String key;
|
|
18 private DigiImage digiImage;
|
26
|
19 public DigiImagePropertyListener(String key, DigiImage digiImage){
|
25
|
20 this.key = key;
|
|
21 this.digiImage = digiImage;
|
|
22 }
|
|
23
|
|
24
|
|
25
|
|
26 public void modifyText(ModifyEvent event) {
|
|
27 DigiImageProperties properties = (DigiImageProperties) digiImage
|
|
28 .getAdapter(IPropertySource.class);
|
|
29 Text t = (Text)event.getSource();
|
|
30 String c = t.getText();
|
|
31 System.out.println(c);
|
|
32
|
|
33 properties.setPropertyValueNoDraw(key, (String)c);
|
|
34 }
|
|
35
|
|
36
|
|
37
|
|
38 }
|
|
39
|
|
40
|