Search in sources :

Example 1 with ProjectReferenceComposite

use of com.twinsoft.convertigo.eclipse.swt.ProjectReferenceComposite in project convertigo by convertigo.

the class ImportWizardPage method createControl.

/* (non-Javadoc)
	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
	 */
public void createControl(Composite parent) {
    Composite page = new Composite(parent, SWT.NONE);
    page.setLayout(new GridLayout(2, false));
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    gd.horizontalSpan = 2;
    Composite fileSelectionArea = new Composite(page, SWT.NONE);
    fileSelectionArea.setLayoutData(gd);
    editor = new ProjectFileFieldEditor("fileSelect", "Select File: ", fileSelectionArea);
    editor.getTextControl(fileSelectionArea).addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            IPath path = new Path(ImportWizardPage.this.editor.getStringValue());
            filePath = path.toString();
            updateStatus();
        }
    });
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    gd.horizontalSpan = 2;
    new Label(page, SWT.HORIZONTAL | SWT.SEPARATOR).setLayoutData(gd);
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    gd.horizontalSpan = 2;
    Label label = new Label(page, SWT.NONE);
    label.setLayoutData(gd);
    label.setText("Project can also be imported by a \"Project remote URL\":");
    gd = new GridData(SWT.FILL, SWT.FILL, true, false);
    gd.horizontalSpan = 2;
    projectReferenceComposite = new ProjectReferenceComposite(page, SWT.NONE, new ProjectUrlParser(""), () -> updateStatus());
    projectReferenceComposite.setLayoutData(gd);
    updateStatus();
    setControl(page);
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) ProjectReferenceComposite(com.twinsoft.convertigo.eclipse.swt.ProjectReferenceComposite) ProjectUrlParser(com.twinsoft.convertigo.engine.util.ProjectUrlParser) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ProjectReferenceComposite(com.twinsoft.convertigo.eclipse.swt.ProjectReferenceComposite) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) IPath(org.eclipse.core.runtime.IPath) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Aggregations

ProjectReferenceComposite (com.twinsoft.convertigo.eclipse.swt.ProjectReferenceComposite)1 ProjectUrlParser (com.twinsoft.convertigo.engine.util.ProjectUrlParser)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1