@Override protected Control createDialogArea(Composite dialogArea) { dialogArea = (Composite) super.createDialogArea(dialogArea); LayoutUtil.addGDDummy(dialogArea); final Composite inputComposite = new Composite(dialogArea, SWT.NONE); inputComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); inputComposite.setLayout(LayoutUtil.applyCompositeDefaults(new GridLayout(), 2)); fLocationGroup = new ResourceInputComposite( inputComposite, ResourceInputComposite.STYLE_COMBO, fMode, Messages.Util_SelectFile_File_label); fLocationGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); fLocationGroup.setHistory(getDialogSettings().getArray(fHistoryId)); LayoutUtil.addSmallFiller(dialogArea, true); final ToolInfoGroup info = new ToolInfoGroup(dialogArea, fTool); info.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); final DatabindingSupport databinding = new DatabindingSupport(dialogArea); addBindings(databinding); databinding.installStatusListener(new TitleAreaStatusUpdater(this)); return dialogArea; }
protected void addBindings(final DatabindingSupport db) { final IFileStore current = fTool.getWorkspaceData().getWorkspaceDir(); String dir = ""; // $NON-NLS-1$ if (current != null) { final IPath path = URIUtil.toPath(current.toURI()); if (path != null) { dir = path.toOSString(); } } fNewLocationString = new WritableValue(dir, String.class); db.getContext() .bindValue( fLocationGroup.getObservable(), fNewLocationString, new UpdateValueStrategy().setAfterGetValidator(fLocationGroup.getValidator()), null); }