package com.quantum.properties; import java.sql.SQLException; import com.quantum.model.Bookmark; import com.quantum.model.NotConnectedException; import com.quantum.view.bookmark.TreeNode; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.ui.dialogs.PropertyPage; public class DatabaseInformationPropertyPage extends PropertyPage { public DatabaseInformationPropertyPage() { super(); } protected Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.numColumns = 2; composite.setLayout(layout); GridData data = new GridData(GridData.FILL); data.grabExcessHorizontalSpace = true; composite.setLayoutData(data); Label productLabel = new Label(composite, SWT.NONE); productLabel.setText("Product:"); Label productDescriptionLabel = new Label(composite, SWT.NONE); Bookmark bookmark = ((TreeNode) getElement()).getBookmark(); String description = null; try { description = bookmark.getDatabase().getInformation(); } catch (NotConnectedException e) { } catch (SQLException e) { } if (description == null) { description = ""; } productDescriptionLabel.setText(description); return composite; } protected void performDefaults() { } public boolean performOk() { return true; } }