public void widgetDefaultSelected(SelectionEvent selectionevent) {
widgetSelected(selectionevent);
}
public void widgetSelected(SelectionEvent selectionevent) {
ContainerSelectionDialog containerDialog = new ContainerSelectionDialog(getEditorSite().getShell(), project, false, "Select the folder to write autogenerated files into.");
containerDialog.open();
Object[] selectedContainers = containerDialog.getResult();
if (selectedContainers != null && selectedContainers.length > 0) {
IPath selectedPath = (IPath) selectedContainers[0];
IFolder selectedFolder = project.getParent().getFolder(selectedPath);
IPath projectRelativePath = selectedFolder.getProjectRelativePath();
EOGeneratorFormPage.this.getModel().setDestination(projectRelativePath.toPortableString());
}
destination.forceFocus();
}
});
Label subclassDestinationLabel = toolkit.createLabel(pathsSection, "Subclass Destination:");
subclassDestinationLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
final Text subclassDestination = toolkit.createText(pathsSection, null);
subclassDestination.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
_bindingContext.bindValue(SWTObservables.observeText(subclassDestination, SWT.Modify), BeansObservables.observeValue(_model, EOGeneratorModel.SUBCLASS_DESTINATION), null, null);
Button subclassDestinationBrowse = toolkit.createButton(pathsSection, "Browse...", SWT.PUSH);
subclassDestinationBrowse.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent selectionevent) {
widgetSelected(selectionevent);
}
public void widgetSelected(SelectionEvent selectionevent) {
ContainerSelectionDialog containerDialog = new ContainerSelectionDialog(getEditorSite().getShell(), project, false, "Select the folder to generate customizable files into.");
containerDialog.open();
Object[] selectedContainers = containerDialog.getResult();
if (selectedContainers != null && selectedContainers.length > 0) {
IPath selectedPath = (IPath) selectedContainers[0];
IFolder selectedFolder = project.getParent().getFolder(selectedPath);
IPath projectRelativePath = selectedFolder.getProjectRelativePath();
EOGeneratorFormPage.this.getModel().setSubclassDestination(projectRelativePath.toPortableString());