1 package com.quantum.properties;
3 import com.quantum.model.Bookmark;
4 import com.quantum.model.BookmarkHolder;
5 import com.quantum.view.SchemaSelectionControl;
7 import org.eclipse.swt.widgets.Composite;
8 import org.eclipse.swt.widgets.Control;
9 import org.eclipse.ui.dialogs.PropertyPage;
11 public class SchemaPropertyPage extends PropertyPage {
13 private SchemaSelectionControl control;
15 protected Control createContents(Composite parent) {
16 return this.control = new SchemaSelectionControl(parent, getBookmark());
19 private Bookmark getBookmark() {
21 ((BookmarkHolder) getElement()).getBookmark();
26 * @see org.eclipse.jface.preference.PreferencePage#performApply()
28 public boolean performOk() {
29 Bookmark bookmark = getBookmark();
30 bookmark.setSchemaSelections(this.control.getSchemas());
31 bookmark.setSchemaRule(this.control.getSchemaRule());
35 protected void performDefaults() {
36 super.performDefaults();
37 Bookmark bookmark = getBookmark();
38 this.control.setSchemaRule(bookmark.getSchemaRule());
39 this.control.setSchemas(bookmark.getSchemaSelections());