Mercurial > hg > de.mpg.mpiwg.itgroup.digilib.core
diff src/de/mpg/mpiwg/itgroup/digilib/digiImage/properties/DigiImagePropertySection.java @ 26:183c3e96f6c3
cleaned code
author | dwinter |
---|---|
date | Mon, 10 Jan 2011 12:01:25 +0100 |
parents | 6e7bb3467531 |
children | fbcf122a6a24 |
line wrap: on
line diff
--- a/src/de/mpg/mpiwg/itgroup/digilib/digiImage/properties/DigiImagePropertySection.java Mon Jan 10 11:38:03 2011 +0100 +++ b/src/de/mpg/mpiwg/itgroup/digilib/digiImage/properties/DigiImagePropertySection.java Mon Jan 10 12:01:25 2011 +0100 @@ -1,33 +1,33 @@ package de.mpg.mpiwg.itgroup.digilib.digiImage.properties; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; -import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.views.properties.IPropertySource; import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection; import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.eclipse.jface.util.Assert; import de.mpg.mpiwg.itgroup.digilib.digiImage.DigiImage; import de.mpg.mpiwg.itgroup.digilib.digiImage.DigiImageParameter; +/** + * @author dwinter + * Shows the properties of a digiImage + * + */ public class DigiImagePropertySection extends AbstractPropertySection { private DigiImage digiImage; @@ -37,11 +37,11 @@ private Map<String,ModifyListener> listeners = new HashMap<String,ModifyListener>(); private Button button; - - + - - + /* (non-Javadoc) + * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#createControls(org.eclipse.swt.widgets.Composite, org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage) + */ public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); @@ -79,20 +79,27 @@ } + /* (non-Javadoc) + * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#setInput(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) + */ public void setInput(IWorkbenchPart part, ISelection selection) { super.setInput(part, selection); - Assert.isTrue(selection instanceof IStructuredSelection); + //Assert.isTrue(selection instanceof IStructuredSelection); + assert (IStructuredSelection.class.isInstance(selection)==true) : "wrong instance type"; + Object input = ((IStructuredSelection) selection).getFirstElement(); - Assert.isTrue(input instanceof DigiImage); + //Assert.isTrue(input instanceof DigiImage); + + assert (DigiImage.class.isInstance(input)==true) : "wrong instance type for input"; this.digiImage = (DigiImage) input; - Map<String, String> pms = digiImage.getParameter().createMapFromParameters(null); + //Map<String, String> pms = digiImage.getParameter().createMapFromParameters(null); for(String key: digiImage.getParameter().createMapFromParameters(null).keySet()){ - ModifyListener listener = new PropertyListener(key,digiImage); + ModifyListener listener = new DigiImagePropertyListener(key,digiImage); texts.get(key).addModifyListener(listener); listeners.put(key, listener); @@ -101,6 +108,9 @@ } + /* (non-Javadoc) + * @see org.eclipse.ui.views.properties.tabbed.AbstractPropertySection#refresh() + */ public void refresh() { DigiImageProperties properties = (DigiImageProperties) digiImage @@ -118,11 +128,5 @@ super.refresh(); } - @Override - public void aboutToBeShown() { - System.out.println("about to be shown"); - - - super.aboutToBeShown(); - } + }