Search in sources :

Example 1 with ColumnInfoPanel

use of org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel in project dbeaver by serge-rider.

the class ValueViewDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    /*
        SashForm sash = new SashForm(parent, SWT.VERTICAL);
        sash.setLayoutData(new GridData(GridData.FILL_BOTH));
        Composite dialogGroup = (Composite)super.createDialogArea(sash);
        dialogGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        new ColumnInfoPanel(dialogGroup, SWT.BORDER, getValueController());
        Composite editorGroup = (Composite) super.createDialogArea(sash);
        editorGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
        //editorGroup.setLayout(new GridLayout(1, false));
        return editorGroup;

*/
    Composite dialogGroup = (Composite) super.createDialogArea(parent);
    if (valueController instanceof IAttributeController) {
        final Link columnHideLink = new Link(dialogGroup, SWT.NONE);
        columnHideLink.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                columnInfoVisible = !columnInfoVisible;
                dialogSettings.put(getInfoVisiblePrefId(), columnInfoVisible);
                initColumnInfoVisibility(columnHideLink);
                getShell().layout();
                int width = getShell().getSize().x;
                getShell().setSize(width, getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
            }
        });
        columnPanel = new ColumnInfoPanel(dialogGroup, SWT.BORDER, valueController);
        columnPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
        initColumnInfoVisibility(columnHideLink);
    }
    return dialogGroup;
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) ColumnInfoPanel(org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel)

Example 2 with ColumnInfoPanel

use of org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel in project dbeaver by serge-rider.

the class ContentEditor method createPageContainer.

@Override
protected Composite createPageContainer(Composite parent) {
    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    panel.setLayout(layout);
    if (parent.getLayout() instanceof GridLayout) {
        panel.setLayoutData(new GridData(GridData.FILL_BOTH));
    }
    {
        IValueController valueController = getValueController();
        assert valueController != null;
        infoPanel = new ColumnInfoPanel(panel, SWT.NONE, valueController);
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.exclude = true;
        infoPanel.setLayoutData(gd);
        infoPanel.setVisible(false);
    }
    Composite editotPanel = new Composite(panel, SWT.NONE);
    layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    editotPanel.setLayout(layout);
    editotPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
    return editotPanel;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) ColumnInfoPanel(org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel) IValueController(org.jkiss.dbeaver.ui.data.IValueController)

Aggregations

GridData (org.eclipse.swt.layout.GridData)2 ColumnInfoPanel (org.jkiss.dbeaver.ui.dialogs.ColumnInfoPanel)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 IValueController (org.jkiss.dbeaver.ui.data.IValueController)1