public String getFormId() { return this.getExternalFrameElement( "cf_id" ).getPropertyString( "value" ); }
public void onClick( ClickEvent event ) { sfc.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL ); sfc.setId( customFormPopUp.getFormId() ); sfc.setValue( customFormPopUp.getFormValue() ); doTypeChosen( customFormPopUp ); } } );
public void onClick( ClickEvent event ) { hide(); } } );
public void onClick( ClickEvent event ) { final CustomFormPopUp customFormPopUp = new CustomFormPopUp( GuidedRuleEditorImages508.INSTANCE.Wizard(), Constants.INSTANCE.FieldValue(), DSLCustomFormButton.this.customFormConfiguration ); customFormPopUp.addOkButtonHandler( new ClickHandler() { public void onClick( ClickEvent event ) { String id = customFormPopUp.getFormId(); String value = customFormPopUp.getFormValue(); btnCustomForm.setText( value ); selectedValue = new DSLComplexVariableValue( id, value ); updateSentence(); makeDirty(); customFormPopUp.hide(); } } ); //if selectedValue is an instance of DSLComplexVariableValue, //then both id and value are passed to the custom form //if not, only the value is passed and "" is passed as id if ( selectedValue instanceof DSLComplexVariableValue ) { DSLComplexVariableValue complexSelectedValue = (DSLComplexVariableValue) selectedValue; customFormPopUp.show( complexSelectedValue.getId(), complexSelectedValue.getValue() ); } else { customFormPopUp.show( "", selectedValue.getValue() ); } } } );
public void show( String selectedId, String selectedValue ) { String url = configuration.getCustomFormURL(); if ( url == null || url.trim().equals( "" ) ) { //TODO: show an error return; } else { String parameters = "cf_id=" + selectedId + "&cf_value=" + selectedValue + "&factType=" + this.configuration.getFactType() + "&fieldName=" + this.configuration.getFieldName(); //advanced url parsing for adding attributes :P url = url + ( url.contains( "?" ) ? "&" : "?" ) + parameters; this.externalFrame.setUrl( url ); this.show(); } }
public CustomFormPopUp( Image image, String title, CustomFormConfiguration configuration ) { super( image, title ); this.configuration = configuration; this.externalFrame = new Frame(); this.externalFrame.setWidth( configuration.getCustomFormWidth() + "px" ); this.externalFrame.setHeight( configuration.getCustomFormHeight() + "px" ); VerticalPanel vp = new VerticalPanel(); vp.setWidth( "100%" ); vp.setHeight( "100%" ); vp.add( this.externalFrame ); okButton = new Button( Constants.INSTANCE.OK() ); //cancel button with default handler cancelButton = new Button( Constants.INSTANCE.Cancel(), new ClickHandler() { public void onClick( ClickEvent event ) { hide(); } } ); HorizontalPanel hp = new HorizontalPanel(); hp.setWidth( "100%" ); hp.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER ); hp.add( okButton ); hp.add( cancelButton ); vp.add( hp ); this.addRow( vp ); }
return; final CustomFormPopUp customFormPopUp = new CustomFormPopUp( GuidedRuleEditorImages508.INSTANCE.Wizard(), Constants.INSTANCE.FieldValue(), customFormConfiguration ); customFormPopUp.addOkButtonHandler( new ClickHandler() { customFormPopUp.show( sfc.getId(), sfc.getValue() ); return;
public String getFormValue() { return this.getExternalFrameElement( "cf_value" ).getPropertyString( "value" ); }