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
|
|
10 public class PropertyListener implements ModifyListener {
|
|
11
|
|
12 private String key;
|
|
13 private DigiImage digiImage;
|
|
14 public PropertyListener(String key, DigiImage digiImage){
|
|
15 this.key = key;
|
|
16 this.digiImage = digiImage;
|
|
17 }
|
|
18
|
|
19
|
|
20
|
|
21 public void modifyText(ModifyEvent event) {
|
|
22 DigiImageProperties properties = (DigiImageProperties) digiImage
|
|
23 .getAdapter(IPropertySource.class);
|
|
24 Text t = (Text)event.getSource();
|
|
25 String c = t.getText();
|
|
26 System.out.println(c);
|
|
27
|
|
28 properties.setPropertyValueNoDraw(key, (String)c);
|
|
29 }
|
|
30
|
|
31
|
|
32
|
|
33 }
|
|
34
|
|
35
|