1 package com.quantum.properties;
3 import java.sql.SQLException;
5 import com.quantum.model.Bookmark;
6 import com.quantum.model.NotConnectedException;
7 import com.quantum.view.bookmark.TreeNode;
9 import org.eclipse.swt.SWT;
10 import org.eclipse.swt.layout.GridData;
11 import org.eclipse.swt.layout.GridLayout;
12 import org.eclipse.swt.widgets.Composite;
13 import org.eclipse.swt.widgets.Control;
14 import org.eclipse.swt.widgets.Label;
15 import org.eclipse.ui.dialogs.PropertyPage;
17 public class DatabaseInformationPropertyPage extends PropertyPage {
19 public DatabaseInformationPropertyPage() {
23 protected Control createContents(Composite parent) {
25 Composite composite = new Composite(parent, SWT.NONE);
26 GridLayout layout = new GridLayout();
27 layout.numColumns = 2;
28 composite.setLayout(layout);
29 GridData data = new GridData(GridData.FILL);
30 data.grabExcessHorizontalSpace = true;
31 composite.setLayoutData(data);
33 Label productLabel = new Label(composite, SWT.NONE);
34 productLabel.setText("Product:");
36 Label productDescriptionLabel = new Label(composite, SWT.NONE);
39 ((TreeNode) getElement()).getBookmark();
40 String description = null;
42 description = bookmark.getDatabase().getInformation();
43 } catch (NotConnectedException e) {
44 } catch (SQLException e) {
46 if (description == null) {
47 description = "<unknown>";
49 productDescriptionLabel.setText(description);
53 protected void performDefaults() {
56 public boolean performOk() {