Search in sources :

Example 1 with StatusDialog

use of org.eclipse.jface.dialogs.StatusDialog in project webtools.sourceediting by eclipse.

the class XSLLaunchShortcut method promptForStylesheet.

private void promptForStylesheet() {
    // prompt for input xml file
    final LaunchPipeline promptedPipeline = new LaunchPipeline();
    StatusDialog dialog = new StatusDialog(getShell()) {

        private TransformsBlock transformsBlock = new TransformsBlock();

        @Override
        protected Control createDialogArea(Composite parent) {
            Composite comp = (Composite) super.createDialogArea(parent);
            comp.setFont(parent.getFont());
            GridLayout layout = new GridLayout(1, false);
            comp.setLayout(layout);
            Label label = new Label(comp, SWT.NONE);
            label.setFont(comp.getFont());
            GridData gd = new GridData();
            gd.horizontalIndent = 5;
            gd.verticalIndent = 5;
            gd.widthHint = 380;
            label.setLayoutData(gd);
            label.setText(Messages.XSLLaunchShortcut_7);
            promptedPipeline.setTransformDefs(new ArrayList<LaunchTransform>());
            transformsBlock.setPipeline(promptedPipeline);
            transformsBlock.createControl(comp);
            transformsBlock.initializeFrom(null);
            return comp;
        }

        @Override
        protected void okPressed() {
            savePipeline();
            super.okPressed();
        }

        private void savePipeline() {
            pipeline = promptedPipeline;
        }
    };
    dialog.setHelpAvailable(false);
    dialog.setStatusLineAboveButtons(true);
    dialog.setTitle(Messages.XSLLaunchShortcut_1);
    dialog.open();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) LaunchTransform(org.eclipse.wst.xsl.launching.config.LaunchTransform) Composite(org.eclipse.swt.widgets.Composite) LaunchPipeline(org.eclipse.wst.xsl.launching.config.LaunchPipeline) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) StatusDialog(org.eclipse.jface.dialogs.StatusDialog) TransformsBlock(org.eclipse.wst.xsl.internal.debug.ui.tabs.main.TransformsBlock)

Example 2 with StatusDialog

use of org.eclipse.jface.dialogs.StatusDialog in project webtools.sourceediting by eclipse.

the class XSLLaunchShortcut method promptForInput.

private void promptForInput() {
    // prompt for input xml file
    StatusDialog dialog = new StatusDialog(getShell()) {

        private InputFileBlock inputFileBlock = new InputFileBlock(null);

        @Override
        protected Control createDialogArea(Composite parent) {
            Composite comp = (Composite) super.createDialogArea(parent);
            comp.setFont(parent.getFont());
            GridLayout layout = new GridLayout(1, false);
            comp.setLayout(layout);
            Label label = new Label(comp, SWT.NONE);
            label.setFont(comp.getFont());
            GridData gd = new GridData();
            gd.horizontalIndent = 5;
            gd.verticalIndent = 5;
            gd.widthHint = 380;
            label.setLayoutData(gd);
            label.setText(Messages.XSLLaunchShortcut_0);
            inputFileBlock.createControl(comp);
            return comp;
        }

        @Override
        protected void okPressed() {
            saveSelectedXmlFile();
            super.okPressed();
        }

        private void saveSelectedXmlFile() {
            IResource res = inputFileBlock.getResource();
            if (res == null)
                xmlFilePath = new Path(inputFileBlock.getText());
            else if (ResourcesPlugin.getWorkspace().getRoot().exists(res.getFullPath()) && res.getType() == IResource.FILE)
                xmlFile = (IFile) res;
        }
    };
    dialog.setHelpAvailable(false);
    dialog.setStatusLineAboveButtons(true);
    dialog.setTitle(Messages.XSLLaunchShortcut_1);
    dialog.open();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) InputFileBlock(org.eclipse.wst.xsl.internal.debug.ui.tabs.main.InputFileBlock) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) StatusDialog(org.eclipse.jface.dialogs.StatusDialog) IResource(org.eclipse.core.resources.IResource)

Aggregations

StatusDialog (org.eclipse.jface.dialogs.StatusDialog)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 IResource (org.eclipse.core.resources.IResource)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 InputFileBlock (org.eclipse.wst.xsl.internal.debug.ui.tabs.main.InputFileBlock)1 TransformsBlock (org.eclipse.wst.xsl.internal.debug.ui.tabs.main.TransformsBlock)1 LaunchPipeline (org.eclipse.wst.xsl.launching.config.LaunchPipeline)1 LaunchTransform (org.eclipse.wst.xsl.launching.config.LaunchTransform)1