Search in sources :

Example 1 with WholeModelBrowseChooser

use of org.whole.lang.ui.controls.WholeModelBrowseChooser in project whole by wholeplatform.

the class TargetModelBlock method createContents.

@Override
protected void createContents(Composite composite) {
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    int widthHint = UIUtils.getButtonWidthHint(composite);
    browseChooser = new WholeModelBrowseChooser(composite, SWT.NONE, widthHint);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint = 300;
    browseChooser.setLayoutData(gd);
    browseChooser.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            IFile file = browseChooser.getFile();
            if (file != null)
                modelPath = file.getFullPath().toPortableString();
            IPersistenceKit persistenceKit = browseChooser.getPersistenceKit();
            if (persistenceKit != null)
                persistenceKitId = persistenceKit.getId();
            updateLaunchConfiguration();
        }
    });
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) IFile(org.eclipse.core.resources.IFile) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) WholeModelBrowseChooser(org.whole.lang.ui.controls.WholeModelBrowseChooser) IPersistenceKit(org.whole.lang.codebase.IPersistenceKit)

Aggregations

IFile (org.eclipse.core.resources.IFile)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 GridData (org.eclipse.swt.layout.GridData)1 IPersistenceKit (org.whole.lang.codebase.IPersistenceKit)1 WholeModelBrowseChooser (org.whole.lang.ui.controls.WholeModelBrowseChooser)1