www.phpeclipse.de
**********************************************************************/
-import net.sourceforge.phpdt.core.ICompilationUnit;
-import net.sourceforge.phpdt.internal.corext.codemanipulation.StubUtility;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.dialogs.IDialogPage;
/**
* 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;
}
-
- ((PHPFileWizard) this.getWizard()).setFileName(fileText.getText().trim());
}
return false;
}
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);
}
}
}