use of org.eclipse.tm4e.languageconfiguration.internal.widgets.LanguageConfigurationInfoWidget in project tm4e by eclipse.
the class SelectLanguageConfigurationWizardPage method createBody.
protected void createBody(Composite ancestor) {
Composite parent = new Composite(ancestor, SWT.NONE);
parent.setFont(parent.getFont());
parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
parent.setLayout(new GridLayout(2, false));
fileText = createText(parent, LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_file);
fileText.addListener(SWT.Modify, this);
Composite buttons = new Composite(parent, SWT.NONE);
buttons.setLayout(new GridLayout(2, false));
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
gd.horizontalAlignment = SWT.RIGHT;
buttons.setLayoutData(gd);
infoWidget = new LanguageConfigurationInfoWidget(parent, SWT.NONE);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
infoWidget.setLayoutData(data);
browseFileSystemButton = new Button(buttons, SWT.NONE);
browseFileSystemButton.setText(LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_browse_fileSystem);
browseFileSystemButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog dialog = new FileDialog(parent.getShell());
dialog.setFilterExtensions(TEXTMATE_EXTENSIONS);
dialog.setFilterPath(fileText.getText());
String result = dialog.open();
if (result != null && result.length() > 0) {
fileText.setText(result);
}
}
});
browseWorkspaceButton = new Button(buttons, SWT.NONE);
browseWorkspaceButton.setText(LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_browse_workspace);
browseWorkspaceButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ResourceSelectionDialog dialog = new ResourceSelectionDialog(browseWorkspaceButton.getShell(), ResourcesPlugin.getWorkspace().getRoot(), LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_workspace_description);
dialog.setTitle(LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_workspace_title);
int returnCode = dialog.open();
Object[] results = dialog.getResult();
if (returnCode == 0 && results.length > 0) {
fileText.setText(((IResource) results[0]).getFullPath().makeRelative().toString());
}
}
});
contentTypeText = createText(parent, LanguageConfigurationMessages.SelectLanguageConfigurationWizardPage_contentType);
contentTypeText.addListener(SWT.Modify, this);
createContentTypeTreeViewer(parent);
}
Aggregations