Skip to content

Commit

Permalink
BZ 1083547 - Simulation engine: Label for time unit is incorrect [min…
Browse files Browse the repository at this point in the history
…utes]
  • Loading branch information
Tihomir Surdilovic committed Apr 8, 2014
1 parent d4cc086 commit af995fa
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.jbpm.designer.notification;

public class DesignerNotificationEvent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ private String presentInterval(int interval, String intervalUnit) {
retVal = interval + " seconds";
} else if(intervalUnit.equals("minutes")) {
interval = interval / (1000*60);
retVal = interval + " minutess";
retVal = interval + " minutes";
} else if(intervalUnit.equals("hours")) {
interval = interval / (1000*60*60);
retVal = interval + " hours";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.jbpm.designer.client.notification;

/**
* Created with IntelliJ IDEA.
* User: tihomirsurdilovic
* Date: 4/8/14
* Time: 10:21 AM
* To change this template use File | Settings | File Templates.
*/
public class DesignerNotificationPopupsManager {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package org.jbpm.designer.client.popups;

import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.constants.BackdropType;
import com.github.gwtbootstrap.client.ui.event.HiddenEvent;
import com.github.gwtbootstrap.client.ui.event.HiddenHandler;
import com.github.gwtbootstrap.client.ui.event.ShowEvent;
import com.github.gwtbootstrap.client.ui.event.ShowHandler;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;
import org.uberfire.client.workbench.widgets.common.ModalFooterOKButton;
import org.uberfire.mvp.Command;

/**
* A popup that shows an error message
*/
public class ErrorPopup extends Modal {

interface ErrorPopupWidgetBinder
extends
UiBinder<Widget, ErrorPopup> {

}

private static ErrorPopupWidgetBinder uiBinder = GWT.create( ErrorPopupWidgetBinder.class );

private static ErrorPopup instance = new ErrorPopup();

@UiField
protected HTML message;

private ErrorPopup() {
setTitle( "Error" );
setMaxHeigth( ( Window.getClientHeight() * 0.75 ) + "px" );
setBackdrop( BackdropType.STATIC );
setKeyboard( true );
setAnimation( true );
setDynamicSafe( true );
setHideOthers( false );

add( uiBinder.createAndBindUi( this ) );
add( new ModalFooterOKButton( new Command() {
@Override
public void execute() {
hide();
}
} ) );
}

public void setMessage( final String message ) {
this.message.setHTML( SafeHtmlUtils.fromTrustedString( message ) );
}

public static void showMessage( String message ) {
instance.setMessage( message );
instance.show();
}

public static void showMessage( final String msg,
final Command afterShow,
final Command afterClose ) {
new ErrorPopup() {{
setMessage( msg );
addShowHandler( new ShowHandler() {
@Override
public void onShow( final ShowEvent showEvent ) {
if ( afterShow != null ) {
afterShow.execute();
}
}
} );
addHiddenHandler( new HiddenHandler() {
@Override
public void onHidden( final HiddenEvent hiddenEvent ) {
if ( afterClose != null ) {
afterClose.execute();
}
}
} );
}}.show();
}

}

0 comments on commit af995fa

Please sign in to comment.