Search in sources :

Example 1 with SaveFileFieldEditor

use of eu.esdihumboldt.hale.ui.util.io.SaveFileFieldEditor in project hale by halestudio.

the class FileTarget method createControls.

@Override
public void createControls(Composite parent) {
    getPage().setDescription("Please select a destination file for the export");
    parent.setLayout(new GridLayout(3, false));
    targetFile = new SaveFileFieldEditor("targetFile", "Target file:", true, FileFieldEditor.VALIDATE_ON_KEY_STROKE, parent);
    targetFile.setEmptyStringAllowed(false);
    targetFile.setAllowUri(true);
    targetFile.setPage(getPage());
    targetFile.setPropertyChangeListener(new IPropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent event) {
            if (event.getProperty().equals(FieldEditor.IS_VALID)) {
                updateState();
            } else if (event.getProperty().equals(FieldEditor.VALUE)) {
                updateContentType();
            }
        }
    });
    updateState();
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) GridLayout(org.eclipse.swt.layout.GridLayout) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) SaveFileFieldEditor(eu.esdihumboldt.hale.ui.util.io.SaveFileFieldEditor)

Aggregations

SaveFileFieldEditor (eu.esdihumboldt.hale.ui.util.io.SaveFileFieldEditor)1 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)1 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)1 GridLayout (org.eclipse.swt.layout.GridLayout)1