Search in sources :

Example 1 with CompareObjectsSettings

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings in project dbeaver by serge-rider.

the class CompareObjectsPageSettings method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    composite.setLayout(gl);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    final CompareObjectsSettings settings = getWizard().getSettings();
    {
        Group sourceSettings = new Group(composite, SWT.NONE);
        sourceSettings.setText("Objects");
        gl = new GridLayout(1, false);
        sourceSettings.setLayout(gl);
        sourceSettings.setLayoutData(new GridData(GridData.FILL_BOTH));
        nodesTable = new Table(sourceSettings, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
        nodesTable.setLayoutData(new GridData(GridData.FILL_BOTH));
        nodesTable.setHeaderVisible(true);
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Name");
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Type");
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Full qualified name");
        for (DBNDatabaseNode node : settings.getNodes()) {
            TableItem item = new TableItem(nodesTable, SWT.NONE);
            item.setImage(DBeaverIcons.getImage(node.getNodeIconDefault()));
            item.setText(0, node.getNodeName());
            item.setText(1, node.getNodeType());
            item.setText(2, node.getNodeFullName());
        }
    }
    {
        Group compareSettings = new Group(composite, SWT.NONE);
        compareSettings.setText("Compare settings");
        compareSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        compareSettings.setLayout(new GridLayout(1, false));
        skipSystemObjects = UIUtils.createCheckbox(compareSettings, "Skip system objects", settings.isSkipSystemObjects());
        skipSystemObjects.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setSkipSystemObjects(skipSystemObjects.getSelection());
            }
        });
        compareLazyProperties = UIUtils.createCheckbox(compareSettings, "Compare expensive properties", settings.isCompareLazyProperties());
        compareLazyProperties.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareLazyProperties(compareLazyProperties.getSelection());
            }
        });
        compareOnlyStructure = UIUtils.createCheckbox(compareSettings, "Compare only structure (ignore properties)", settings.isCompareOnlyStructure());
        compareOnlyStructure.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareOnlyStructure(compareOnlyStructure.getSelection());
            }
        });
        compareScriptProperties = UIUtils.createCheckbox(compareSettings, "Compare scripts/procedures", settings.isCompareScripts());
        compareScriptProperties.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareScripts(compareScriptProperties.getSelection());
            }
        });
    }
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) CompareObjectsSettings(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DBNDatabaseNode(org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)

Example 2 with CompareObjectsSettings

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings in project dbeaver by serge-rider.

the class CompareObjectsPageOutput method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    composite.setLayout(gl);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    final CompareObjectsSettings settings = getWizard().getSettings();
    {
        Group reportSettings = new Group(composite, SWT.NONE);
        reportSettings.setText("Report settings");
        gl = new GridLayout(1, false);
        reportSettings.setLayout(gl);
        reportSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        showOnlyDifference = UIUtils.createCheckbox(reportSettings, "Show only differences", settings.isShowOnlyDifferences());
        showOnlyDifference.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setShowOnlyDifferences(showOnlyDifference.getSelection());
            }
        });
    }
    {
        Group outputSettings = new Group(composite, SWT.NONE);
        outputSettings.setText("Output");
        gl = new GridLayout(2, false);
        outputSettings.setLayout(gl);
        outputSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(outputSettings, "Output type");
        reportTypeCombo = new Combo(outputSettings, SWT.DROP_DOWN | SWT.READ_ONLY);
        for (CompareObjectsSettings.OutputType outputType : CompareObjectsSettings.OutputType.values()) {
            reportTypeCombo.add(outputType.getTitle());
        }
        reportTypeCombo.select(settings.getOutputType().ordinal());
        reportTypeCombo.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                for (CompareObjectsSettings.OutputType outputType : CompareObjectsSettings.OutputType.values()) {
                    if (outputType.ordinal() == reportTypeCombo.getSelectionIndex()) {
                        settings.setOutputType(outputType);
                        UIUtils.enableWithChildren(outputFolderText.getParent(), outputType == CompareObjectsSettings.OutputType.FILE);
                        break;
                    }
                }
            }
        });
        outputFolderText = DialogUtils.createOutputFolderChooser(outputSettings, null, null);
        outputFolderText.setText(settings.getOutputFolder());
        UIUtils.enableWithChildren(outputFolderText.getParent(), settings.getOutputType() == CompareObjectsSettings.OutputType.FILE);
        outputFolderText.addModifyListener(new ModifyListener() {

            @Override
            public void modifyText(ModifyEvent e) {
                settings.setOutputFolder(outputFolderText.getText());
            }
        });
    }
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) CompareObjectsSettings(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 3 with CompareObjectsSettings

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings in project dbeaver by dbeaver.

the class CompareObjectsPageOutput method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    composite.setLayout(gl);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    final CompareObjectsSettings settings = getWizard().getSettings();
    {
        Group reportSettings = new Group(composite, SWT.NONE);
        reportSettings.setText("Report settings");
        gl = new GridLayout(1, false);
        reportSettings.setLayout(gl);
        reportSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        showOnlyDifference = UIUtils.createCheckbox(reportSettings, "Show only differences", settings.isShowOnlyDifferences());
        showOnlyDifference.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setShowOnlyDifferences(showOnlyDifference.getSelection());
            }
        });
    }
    {
        Group outputSettings = new Group(composite, SWT.NONE);
        outputSettings.setText("Output");
        gl = new GridLayout(2, false);
        outputSettings.setLayout(gl);
        outputSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createControlLabel(outputSettings, "Output type");
        reportTypeCombo = new Combo(outputSettings, SWT.DROP_DOWN | SWT.READ_ONLY);
        for (CompareObjectsSettings.OutputType outputType : CompareObjectsSettings.OutputType.values()) {
            reportTypeCombo.add(outputType.getTitle());
        }
        reportTypeCombo.select(settings.getOutputType().ordinal());
        reportTypeCombo.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                for (CompareObjectsSettings.OutputType outputType : CompareObjectsSettings.OutputType.values()) {
                    if (outputType.ordinal() == reportTypeCombo.getSelectionIndex()) {
                        settings.setOutputType(outputType);
                        UIUtils.enableWithChildren(outputFolderText.getParent(), outputType == CompareObjectsSettings.OutputType.FILE);
                        break;
                    }
                }
            }
        });
        outputFolderText = DialogUtils.createOutputFolderChooser(outputSettings, null, null);
        outputFolderText.setText(settings.getOutputFolder());
        UIUtils.enableWithChildren(outputFolderText.getParent(), settings.getOutputType() == CompareObjectsSettings.OutputType.FILE);
        outputFolderText.addModifyListener(new ModifyListener() {

            @Override
            public void modifyText(ModifyEvent e) {
                settings.setOutputFolder(outputFolderText.getText());
            }
        });
    }
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) CompareObjectsSettings(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent)

Example 4 with CompareObjectsSettings

use of org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings in project dbeaver by dbeaver.

the class CompareObjectsPageSettings method createControl.

@Override
public void createControl(Composite parent) {
    initializeDialogUnits(parent);
    Composite composite = new Composite(parent, SWT.NULL);
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    composite.setLayout(gl);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    final CompareObjectsSettings settings = getWizard().getSettings();
    {
        Group sourceSettings = new Group(composite, SWT.NONE);
        sourceSettings.setText("Objects");
        gl = new GridLayout(1, false);
        sourceSettings.setLayout(gl);
        sourceSettings.setLayoutData(new GridData(GridData.FILL_BOTH));
        nodesTable = new Table(sourceSettings, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
        nodesTable.setLayoutData(new GridData(GridData.FILL_BOTH));
        nodesTable.setHeaderVisible(true);
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Name");
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Type");
        UIUtils.createTableColumn(nodesTable, SWT.LEFT, "Full qualified name");
        for (DBNDatabaseNode node : settings.getNodes()) {
            TableItem item = new TableItem(nodesTable, SWT.NONE);
            item.setImage(DBeaverIcons.getImage(node.getNodeIconDefault()));
            item.setText(0, node.getNodeName());
            item.setText(1, node.getNodeType());
            item.setText(2, node.getNodeFullName());
        }
    }
    {
        Group compareSettings = new Group(composite, SWT.NONE);
        compareSettings.setText("Compare settings");
        compareSettings.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        compareSettings.setLayout(new GridLayout(1, false));
        skipSystemObjects = UIUtils.createCheckbox(compareSettings, "Skip system objects", settings.isSkipSystemObjects());
        skipSystemObjects.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setSkipSystemObjects(skipSystemObjects.getSelection());
            }
        });
        compareLazyProperties = UIUtils.createCheckbox(compareSettings, "Compare expensive properties", settings.isCompareLazyProperties());
        compareLazyProperties.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareLazyProperties(compareLazyProperties.getSelection());
            }
        });
        compareOnlyStructure = UIUtils.createCheckbox(compareSettings, "Compare only structure (ignore properties)", settings.isCompareOnlyStructure());
        compareOnlyStructure.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareOnlyStructure(compareOnlyStructure.getSelection());
            }
        });
        compareScriptProperties = UIUtils.createCheckbox(compareSettings, "Compare scripts/procedures", settings.isCompareScripts());
        compareScriptProperties.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                settings.setCompareScripts(compareScriptProperties.getSelection());
            }
        });
    }
    setControl(composite);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) CompareObjectsSettings(org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) DBNDatabaseNode(org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)

Aggregations

SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)4 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 GridData (org.eclipse.swt.layout.GridData)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 CompareObjectsSettings (org.jkiss.dbeaver.tools.compare.simple.CompareObjectsSettings)4 ModifyEvent (org.eclipse.swt.events.ModifyEvent)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 DBNDatabaseNode (org.jkiss.dbeaver.model.navigator.DBNDatabaseNode)2