[jboss-svn-commits] JBL Code SVN: r9575 - labs/jbossrules/trunk/drools-testing-plugin/src/org/drools/testing/plugin/wizards.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Feb 18 00:21:53 EST 2007
Author: mshaw
Date: 2007-02-18 00:21:53 -0500 (Sun, 18 Feb 2007)
New Revision: 9575
Modified:
labs/jbossrules/trunk/drools-testing-plugin/src/org/drools/testing/plugin/wizards/RtlNewPage.java
Log:
Modified: labs/jbossrules/trunk/drools-testing-plugin/src/org/drools/testing/plugin/wizards/RtlNewPage.java
===================================================================
--- labs/jbossrules/trunk/drools-testing-plugin/src/org/drools/testing/plugin/wizards/RtlNewPage.java 2007-02-18 05:10:04 UTC (rev 9574)
+++ labs/jbossrules/trunk/drools-testing-plugin/src/org/drools/testing/plugin/wizards/RtlNewPage.java 2007-02-18 05:21:53 UTC (rev 9575)
@@ -60,10 +60,31 @@
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
+ label.setText("&Container:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+
+
+ label = new Label(container, SWT.NULL);
label.setText("&Drl:");
fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
fileText.setLayoutData(gd);
fileText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -94,26 +115,6 @@
}
});
- label = new Label(container, SWT.NULL);
- label.setText("&Container:");
-
- containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- containerText.setLayoutData(gd);
- containerText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- dialogChanged();
- }
- });
-
- Button button = new Button(container, SWT.PUSH);
- button.setText("Browse...");
- button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- handleBrowse();
- }
- });
-
initialize();
dialogChanged();
setControl(container);
@@ -133,6 +134,7 @@
String[] extensions = {"*.drl"};
dialog.setFilterExtensions(extensions);
dialog.setFilterPath(".");
+ dialog.setFilterPath(ResourcesPlugin.getWorkspace().getRoot().getProject(getContainerName()).getFullPath().toString());
fileText.setText(dialog.open());
@@ -162,6 +164,15 @@
IResource container = ResourcesPlugin.getWorkspace().getRoot()
.findMember(new Path(getContainerName()));
+ if (container == null
+ || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+ updateStatus("File container must exist");
+ return;
+ }
+ if (!container.isAccessible()) {
+ updateStatus("Project must be writable");
+ return;
+ }
if (fileName.length() == 0) {
updateStatus("File name must be specified");
return;
@@ -178,15 +189,6 @@
updateStatus("File container must be specified");
return;
}
- if (container == null
- || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
- updateStatus("File container must exist");
- return;
- }
- if (!container.isAccessible()) {
- updateStatus("Project must be writable");
- return;
- }
int dotLoc = fileName.lastIndexOf('.');
if (dotLoc != -1) {
String ext = fileName.substring(dotLoc + 1);
More information about the jboss-svn-commits
mailing list