[jboss-svn-commits] JBL Code SVN: r36051 - in labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client: modeldriven/ui and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 24 07:12:41 EST 2010
Author: Rikkola
Date: 2010-11-24 07:12:40 -0500 (Wed, 24 Nov 2010)
New Revision: 36051
Modified:
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/FormStylePopup.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/LoadingPopup.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/Popup.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DatePickerPopUp.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DefaultLiteralEditor.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/EnumDropDownLabel.java
labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/ChoiceList.java
Log:
GUVNOR-1093 : Add shadow to all Guvnor popups
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/FormStylePopup.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/FormStylePopup.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/FormStylePopup.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -36,7 +36,6 @@
title );
setModal( true );
- setGlassEnabled( true );
setTitle( title );
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/LoadingPopup.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/LoadingPopup.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/LoadingPopup.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -34,7 +34,6 @@
setWidth( "200px" );
center();
- setGlassEnabled( true );
}
/** Convenience method to popup the message. */
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/Popup.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/Popup.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/common/Popup.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -44,6 +44,7 @@
private boolean fixedLocation = false;
public Popup() {
+ setGlassEnabled( true );
setWidth( 430 + "px" );
}
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DatePickerPopUp.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DatePickerPopUp.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DatePickerPopUp.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -61,6 +61,7 @@
public DatePickerPopUp(ClickHandler okClickHandler,
DateTimeFormat formatter) {
+ setGlassEnabled( true );
HorizontalPanel horizontalPanel = new HorizontalPanel();
// Add years
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DefaultLiteralEditor.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DefaultLiteralEditor.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/DefaultLiteralEditor.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -50,24 +50,24 @@
*/
public class DefaultLiteralEditor extends Composite {
- private Constants constants = ((Constants) GWT.create( Constants.class ));
+ private Constants constants = ((Constants) GWT.create( Constants.class ));
private BaseSingleFieldConstraint constraint;
- private final boolean numericValue;
+ private final boolean numericValue;
- private Label textWidget = new Label();
+ private Label textWidget = new Label();
- private final Button okButton = new Button( constants.OK() );
- private final ValueChanged valueChanged = new ValueChanged() {
- public void valueChanged(String newValue) {
- constraint.setValue(newValue);
- if (onValueChangeCommand != null){
- onValueChangeCommand.execute();
- }
- okButton.click();
- }
- };
+ private final Button okButton = new Button( constants.OK() );
+ private final ValueChanged valueChanged = new ValueChanged() {
+ public void valueChanged(String newValue) {
+ constraint.setValue( newValue );
+ if ( onValueChangeCommand != null ) {
+ onValueChangeCommand.execute();
+ }
+ okButton.click();
+ }
+ };
- private Command onValueChangeCommand;
+ private Command onValueChangeCommand;
public DefaultLiteralEditor(BaseSingleFieldConstraint constraint,
boolean numericValue) {
@@ -75,13 +75,12 @@
this.numericValue = numericValue;
textWidget.setStyleName( "x-form-field" );
- textWidget.addClickHandler(new ClickHandler() {
-
- public void onClick(ClickEvent event) {
- showPopup();
- }
- });
+ textWidget.addClickHandler( new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ showPopup();
+ }
+ } );
if ( constraint.getValue() != null && !"".equals( constraint.getValue() ) ) {
textWidget.setText( constraint.getValue() );
@@ -95,16 +94,16 @@
private void showPopup() {
final PopupPanel popup = new PopupPanel();
HorizontalPanel horizontalPanel = new HorizontalPanel();
-
+ popup.setGlassEnabled( true );
popup.setPopupPosition( this.getAbsoluteLeft(),
this.getAbsoluteTop() );
- okButton.addClickHandler(new ClickHandler() {
-
- public void onClick(ClickEvent event) {
+ okButton.addClickHandler( new ClickHandler() {
+ public void onClick(ClickEvent event) {
+
if ( !isValueEmpty( constraint.getValue() ) ) {
- if (onValueChangeCommand != null){
+ if ( onValueChangeCommand != null ) {
onValueChangeCommand.execute();
}
textWidget.setText( constraint.getValue() );
@@ -112,7 +111,7 @@
popup.hide();
}
}
- });
+ } );
horizontalPanel.add( getTextBox() );
horizontalPanel.add( okButton );
@@ -126,7 +125,7 @@
public TextBox getTextBox() {
final TextBox box = new BoundTextBox( constraint );
- box.addKeyboardListener( new KeyboardListener() {
+ box.addKeyboardListener( new KeyboardListener() {
public void onKeyDown(Widget arg0,
char arg1,
@@ -148,7 +147,7 @@
if ( '\r' == c || '\n' == c ) {
valueChanged.valueChanged( box.getText() );
} else {
- constraint.setValue(box.getText());
+ constraint.setValue( box.getText() );
}
}
@@ -168,8 +167,8 @@
}
}
- private void executeOnValueChangeCommand(){
- if (this.onValueChangeCommand != null){
+ private void executeOnValueChangeCommand() {
+ if ( this.onValueChangeCommand != null ) {
this.onValueChangeCommand.execute();
}
}
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/EnumDropDownLabel.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/EnumDropDownLabel.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/modeldriven/ui/EnumDropDownLabel.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -87,6 +87,7 @@
private void showPopup() {
final PopupPanel popup = new PopupPanel();
+ popup.setGlassEnabled( true );
HorizontalPanel horizontalPanel = new HorizontalPanel();
popup.setPopupPosition( this.getAbsoluteLeft(),
Modified: labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/ChoiceList.java
===================================================================
--- labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/ChoiceList.java 2010-11-24 11:58:32 UTC (rev 36050)
+++ labs/jbossrules/trunk/drools-guvnor/src/main/java/org/drools/guvnor/client/ruleeditor/ChoiceList.java 2010-11-24 12:12:40 UTC (rev 36051)
@@ -1,5 +1,5 @@
-/**
- * Copyright 2010 JBoss Inc
+/*
+ * Copyright 2005 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,38 +16,27 @@
package org.drools.guvnor.client.ruleeditor;
-/*
- * Copyright 2005 JBoss Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
import java.util.List;
import org.drools.guvnor.client.messages.Constants;
import org.drools.ide.common.client.modeldriven.brl.DSLSentence;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.KeyUpEvent;
+import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.FocusListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.KeyboardListener;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.core.client.GWT;
/**
* This is a popup list for "content assistance" - although on the web,
@@ -59,7 +48,7 @@
private final DSLSentence[] sentences;
private HorizontalPanel buttons;
private TextBox filter;
- private Constants constants = ((Constants) GWT.create(Constants.class));
+ private Constants constants = ((Constants) GWT.create( Constants.class ));
/**
* Pass in a list of suggestions for the popup lists.
@@ -69,37 +58,27 @@
final DSLRuleEditor self) {
super( true );
+ setGlassEnabled( true );
this.sentences = sen;
filter = new TextBox();
filter.setWidth( "100%" );
final String defaultMessage = constants.enterTextToFilterList();
filter.setText( defaultMessage );
- filter.addFocusListener( new FocusListener() {
- public void onFocus(Widget w) {
+ filter.addFocusHandler( new FocusHandler() {
+ public void onFocus(FocusEvent event) {
filter.setText( "" );
}
+ } );
- public void onLostFocus(Widget w) {
+ filter.addBlurHandler( new BlurHandler() {
+ public void onBlur(BlurEvent event) {
filter.setText( defaultMessage );
}
} );
- filter.addKeyboardListener( new KeyboardListener() {
- public void onKeyDown(Widget arg0,
- char arg1,
- int arg2) {
-
- }
-
- public void onKeyPress(Widget arg0,
- char arg1,
- int arg2) {
- }
-
- public void onKeyUp(Widget arg0,
- char arg1,
- int arg2) {
- if ( arg1 == KEY_ENTER ) {
+ filter.addKeyUpHandler( new KeyUpHandler() {
+ public void onKeyUp(KeyUpEvent event) {
+ if ( event.getNativeKeyCode() == KeyCodes.KEY_ENTER ) {
applyChoice( self );
} else {
populateList( ListUtil.filter( sentences,
@@ -122,15 +101,15 @@
panel.add( list );
Button ok = new Button( constants.OK() );
- ok.addClickListener( new ClickListener() {
- public void onClick(Widget btn) {
+ ok.addClickHandler( new ClickHandler() {
+ public void onClick(ClickEvent event) {
applyChoice( self );
}
} );
- Button cancel = new Button(constants.Cancel());
- cancel.addClickListener( new ClickListener() {
- public void onClick(Widget btn) {
+ Button cancel = new Button( constants.Cancel() );
+ cancel.addClickHandler( new ClickHandler() {
+ public void onClick(ClickEvent event) {
hide();
}
} );
@@ -143,7 +122,7 @@
panel.add( buttons );
add( panel );
- setStyleName( "ks-popups-Popup" ); //NON-NLS
+ setStyleName( "ks-popups-Popup" ); //NON-NLS
}
@@ -152,7 +131,7 @@
hide();
}
- private void populateList(List filtered) {
+ private void populateList(List<DSLSentence> filtered) {
list.clear();
for ( int i = 0; i < filtered.size(); i++ ) {
list.addItem( ((DSLSentence) filtered.get( i )).sentence );
More information about the jboss-svn-commits
mailing list