// $Id$
/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
package eu.etaxonomy.taxeditor.preference;
public class MobotOpenUrlPreferences extends PreferencePage implements
IWorkbenchPreferencePage {
-
private String openUrlServiceAccessPoint;
private String openUrlImageMaxWidth;
private String openUrlImageMaxHeight;
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
@Override
public void init(IWorkbench workbench) {
setPreferenceStore(PreferencesUtil.getPreferenceStore());
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse
+ * .swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
final GridLayout gridLayout = new GridLayout();
container.setLayout(gridLayout);
-
+
creatOpenUrlServiceAccessPoint(container);
-
+
createOpenUrlImageSize(container);
-
+
return container;
}
-
+
/**
* @param container
*/
private void createOpenUrlImageSize(Composite container) {
- openUrlImageMaxWidth = getPreferenceStore().getString(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH);
- openUrlImageMaxHeight = getPreferenceStore().getString(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT);
-
+ openUrlImageMaxWidth = getPreferenceStore().getString(
+ IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH);
+ openUrlImageMaxHeight = getPreferenceStore().getString(
+ IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT);
+
Composite composite = new Composite(container, SWT.NULL);
final GridLayout gridLayout = new GridLayout(2, false);
composite.setLayout(gridLayout);
-
+
final CLabel labelWidth = new CLabel(composite, SWT.NULL);
labelWidth.setText("Image Maximum Width: ");
-
+
final Text textWidth = new Text(composite, SWT.BORDER);
textWidth.setText(openUrlImageMaxWidth);
textWidth.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
+
textWidth.addModifyListener(new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
openUrlImageMaxWidth = textWidth.getText();
}
});
-
+
final CLabel labelHeight = new CLabel(composite, SWT.NULL);
labelHeight.setText("Image Maximum Height: ");
-
+
final Text textHeight = new Text(composite, SWT.BORDER);
textHeight.setText(openUrlImageMaxHeight);
textHeight.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
+
textHeight.addModifyListener(new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
openUrlImageMaxHeight = textHeight.getText();
}
}
private void creatOpenUrlServiceAccessPoint(Composite composite) {
- openUrlServiceAccessPoint = getPreferenceStore().getString(IPreferenceKeys.OPENURL_ACCESS_POINT);
-
+ openUrlServiceAccessPoint = getPreferenceStore().getString(
+ IPreferenceKeys.OPENURL_ACCESS_POINT);
+
final CLabel label = new CLabel(composite, SWT.NULL);
label.setText("Mobot Open Url Service Access Point:");
-
+
final Text text = new Text(composite, SWT.BORDER);
text.setText(openUrlServiceAccessPoint);
text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
+
text.addModifyListener(new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
openUrlServiceAccessPoint = text.getText();
}
});
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
@Override
public boolean performOk() {
- getPreferenceStore().setValue(IPreferenceKeys.OPENURL_ACCESS_POINT, openUrlServiceAccessPoint);
- getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH, openUrlImageMaxWidth);
- getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT, openUrlImageMaxHeight);
-
+ getPreferenceStore().setValue(IPreferenceKeys.OPENURL_ACCESS_POINT,
+ openUrlServiceAccessPoint);
+ getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_WIDTH,
+ openUrlImageMaxWidth);
+ getPreferenceStore().setValue(IPreferenceKeys.OPENURL_IMAGE_MAX_HEIGHT,
+ openUrlImageMaxHeight);
+
return super.performOk();
}