[jboss-svn-commits] JBL Code SVN: r24260 - labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/wizard/rule.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Dec 5 19:21:05 EST 2008
Author: KrisVerlaenen
Date: 2008-12-05 19:21:04 -0500 (Fri, 05 Dec 2008)
New Revision: 24260
Modified:
labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/wizard/rule/NewRulePackagePage.java
Log:
JBIDE-3301: Finish button on Rule Wizard enabled before complete
- finish button only enabled if all required information is filled in
Modified: labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/wizard/rule/NewRulePackagePage.java
===================================================================
--- labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/wizard/rule/NewRulePackagePage.java 2008-12-05 23:50:01 UTC (rev 24259)
+++ labs/jbossrules/trunk/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/wizard/rule/NewRulePackagePage.java 2008-12-06 00:21:04 UTC (rev 24260)
@@ -10,6 +10,8 @@
import org.drools.eclipse.DroolsEclipsePlugin;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -51,13 +53,6 @@
this.workbench = workbench;
}
- public void createControl(Composite parent) {
- super.createControl(parent);
- setPageComplete(true);
- super.setMessage( "Hint: Press CTRL+SPACE when editing rules to get content sensitive assistance/popups.");
- }
-
-
protected void createAdvancedControls(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
final GridLayout layout = new GridLayout();
@@ -73,6 +68,10 @@
super.createAdvancedControls( parent );
}
+
+ protected boolean validatePage() {
+ return super.validatePage() && validate();
+ }
private void createPackageName(Composite container) {
//package name
@@ -84,6 +83,11 @@
packageName.setLayoutData( new GridData(GridData.FILL_HORIZONTAL) );
packageName.setToolTipText( "Rules require a namespace." );
packageName.setFont( this.getFont() );
+ packageName.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ setPageComplete(validatePage());
+ }
+ });
}
private void createFunctions(Composite container) {
@@ -160,9 +164,7 @@
}
protected InputStream getInitialContents() {
-
try {
-
DRLGenerator gen = new DRLGenerator();
if (this.ruleFileType.getSelectionIndex() == TYPE_RULE) {
InputStream template = getTemplate("org/drools/eclipse/wizard/rule/new_rule.drl.template");
@@ -186,9 +188,4 @@
return DroolsEclipsePlugin.getDefault().getBundle().getResource(templatePath).openStream();
}
-
-
-
-
-
}
More information about the jboss-svn-commits
mailing list