/**
* Constructor for SampleNewWizardPage.
- *
+ *
* @param pageName
*/
public PHPFileWizardPage(ISelection selection) {
});
Button button = new Button(container, SWT.PUSH);
- button.setText(PHPWizardMessages.getString("WizardPage.browseButtonText"));
+ button.setText(PHPWizardMessages
+ .getString("WizardPage.browseButtonText"));
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleBrowse();
*/
private void initialize() {
- if (selection != null && selection.isEmpty() == false && selection instanceof IStructuredSelection) {
+ if (selection != null && selection.isEmpty() == false
+ && selection instanceof IStructuredSelection) {
IStructuredSelection ssel = (IStructuredSelection) selection;
if (ssel.size() > 1)
return;
*/
private void handleBrowse() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
- PHPWizardMessages.getString("WizardPage.selectNewFileContainer"));
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ PHPWizardMessages
+ .getString("WizardPage.selectNewFileContainer"));
if (dialog.open() == ContainerSelectionDialog.OK) {
Object[] results = dialog.getResult();
if (results.length == 1) {
String fileName = getFileName();
if (container.length() == 0) {
- updateStatus(PHPWizardMessages.getString("WizardPage.containerMustBeSpecified"));
+ updateStatus(PHPWizardMessages
+ .getString("WizardPage.containerMustBeSpecified"));
return;
}
if (fileName.length() == 0) {
protected boolean checkFolderForExistingFile() {
IContainer container = getFileContainer();
if (container != null) {
- IResource file = container.getFile(new Path(fileText.getText().trim()));
+ IResource file = container.getFile(new Path(fileText.getText()
+ .trim()));
if (file != null && file.exists()) {
- this.setErrorMessage(PHPWizardMessages.getString("WizardPage.fileAlreadyExists"));
+ this.setErrorMessage(PHPWizardMessages
+ .getString("WizardPage.fileAlreadyExists"));
return true;
}
}
private IContainer getFileContainer() {
if (containerText.getText() != null) {
- IPath containerPath = new Path(containerText.getText().trim());
+ IPath containerPath = new Path(containerText.getText().trim());
IContainer container = null;
if (containerPath.segmentCount() > 1) {
- container = ResourcesPlugin.getWorkspace().getRoot().getFolder(containerPath);
+ container = ResourcesPlugin.getWorkspace().getRoot().getFolder(
+ containerPath);
} else {
if (containerPath.segmentCount() == 1) {
// this is a project
- container = ResourcesPlugin.getWorkspace().getRoot().getProject(containerText.getText().trim());
+ container = ResourcesPlugin.getWorkspace().getRoot()
+ .getProject(containerText.getText().trim());
}
}
if (container != null && container.exists()) {
super.setVisible(visible);
if (visible) {
String fileName = fileText.getText().trim();
- if (getFileContainer() != null && fileName.equalsIgnoreCase(INITIAL_FILENAME)) {
+ if (getFileContainer() != null
+ && fileName.equalsIgnoreCase(INITIAL_FILENAME)) {
fileText.setFocus();
fileText.setText(fileName);
- fileText.setSelection(0, fileName.length() - (new Path(INITIAL_FILENAME)).getFileExtension().length() - 1);
+ fileText.setSelection(0, fileName.length()
+ - (new Path(INITIAL_FILENAME)).getFileExtension()
+ .length() - 1);
}
}
}