Search in sources :

Example 1 with WindowProperty

use of org.pentaho.di.ui.core.gui.WindowProperty in project pentaho-kettle by pentaho.

the class BaseStepDialog method setSize.

public static void setSize(Shell shell, int prefWidth, int prefHeight) {
    PropsUI props = PropsUI.getInstance();
    WindowProperty winprop = props.getScreen(shell.getText());
    if (winprop != null) {
        winprop.setShell(shell, prefWidth, prefHeight);
    } else {
        shell.layout();
        winprop = new WindowProperty(shell.getText(), false, new Rectangle(0, 0, prefWidth, prefHeight));
        winprop.setShell(shell);
        // Now, as this is the first time it gets opened, try to put it in the middle of the screen...
        Rectangle shellBounds = shell.getBounds();
        Monitor monitor = shell.getDisplay().getPrimaryMonitor();
        if (shell.getParent() != null) {
            monitor = shell.getParent().getMonitor();
        }
        Rectangle monitorClientArea = monitor.getClientArea();
        int middleX = monitorClientArea.x + (monitorClientArea.width - shellBounds.width) / 2;
        int middleY = monitorClientArea.y + (monitorClientArea.height - shellBounds.height) / 2;
        shell.setLocation(middleX, middleY);
    }
}
Also used : WindowProperty(org.pentaho.di.ui.core.gui.WindowProperty) Monitor(org.eclipse.swt.widgets.Monitor) Rectangle(org.eclipse.swt.graphics.Rectangle) PropsUI(org.pentaho.di.ui.core.PropsUI)

Example 2 with WindowProperty

use of org.pentaho.di.ui.core.gui.WindowProperty in project pentaho-kettle by pentaho.

the class StepErrorMetaDialog method dispose.

public void dispose() {
    props.setScreen(new WindowProperty(shell));
    shell.dispose();
}
Also used : WindowProperty(org.pentaho.di.ui.core.gui.WindowProperty)

Example 3 with WindowProperty

use of org.pentaho.di.ui.core.gui.WindowProperty in project pentaho-kettle by pentaho.

the class EnterPreviewRowsDialog method dispose.

public void dispose() {
    props.setScreen(new WindowProperty(shell));
    shell.dispose();
}
Also used : WindowProperty(org.pentaho.di.ui.core.gui.WindowProperty)

Example 4 with WindowProperty

use of org.pentaho.di.ui.core.gui.WindowProperty in project pentaho-kettle by pentaho.

the class LogSettingsDialog method dispose.

public void dispose() {
    props.setScreen(new WindowProperty(shell));
    shell.dispose();
}
Also used : WindowProperty(org.pentaho.di.ui.core.gui.WindowProperty)

Example 5 with WindowProperty

use of org.pentaho.di.ui.core.gui.WindowProperty in project pentaho-kettle by pentaho.

the class NewSubtransDialog method dispose.

public void dispose() {
    props.setScreen(new WindowProperty(shell));
    shell.dispose();
}
Also used : WindowProperty(org.pentaho.di.ui.core.gui.WindowProperty)

Aggregations

WindowProperty (org.pentaho.di.ui.core.gui.WindowProperty)151 Point (org.pentaho.di.core.gui.Point)4 Rectangle (org.eclipse.swt.graphics.Rectangle)3 Monitor (org.eclipse.swt.widgets.Monitor)3 PropsUI (org.pentaho.di.ui.core.PropsUI)3 Composite (org.eclipse.swt.widgets.Composite)2 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2 MalformedURLException (java.net.MalformedURLException)1 ParseException (java.text.ParseException)1 ResourceBundle (java.util.ResourceBundle)1 MessagingException (javax.mail.MessagingException)1 FileObject (org.apache.commons.vfs2.FileObject)1 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 SWTException (org.eclipse.swt.SWTException)1 SashForm (org.eclipse.swt.custom.SashForm)1 DropTarget (org.eclipse.swt.dnd.DropTarget)1 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)1 DropTargetListener (org.eclipse.swt.dnd.DropTargetListener)1 FileTransfer (org.eclipse.swt.dnd.FileTransfer)1