package com.readytalk.examples.swt.widgets.notifications;

import com.readytalk.examples.swt.RunnableExample;
import com.readytalk.examples.swt.SwtBlingExample;
import com.readytalk.swt.widgets.notifications.PopTart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class PopTartExample implements SwtBlingExample {
  @RunnableExample(name="PopTart")
  public PopTartExample() { }

  public void run(Display display, Shell shell) {
    shell.setLayout(new FillLayout());
    Button button = new Button(shell, SWT.PUSH);
    button.setText("Open PopTart");

    final PopTart popTart = PopTart.createPopTart(button);
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        popTart.show();
      }
    });

    Composite composite = new Composite(popTart.getPopTartShell(), SWT.NONE);
    composite.setLayout(new GridLayout());
    Button popTartButton = new Button(composite, SWT.PUSH);
    popTartButton.setText("This button is contained in the PopTart");

    popTart.setComposite(composite);

    shell.pack();
    shell.open();
  }
}

@@ -146,32 +146,87 @@
 wtBlingExample;%0A
+import com.readytalk.swt.widgets.buttons.SquareButton;%0A
 import com.ready
@@ -265,16 +265,16 @@
 opTart;%0A
-
 import o
@@ -387,16 +387,55 @@
 nEvent;%0A
+import org.eclipse.swt.graphics.Image;%0A
 import o
@@ -1299,139 +1299,1292 @@
 out(
+2, true
 ));%0A
+%0A
     
-Button popTartButton = new Button(composite, SWT.PUSH
+Image iconInformation = display.getSystemImage(SWT.ICON_INFORMATION);%0A    Image iconError = display.getSystemImage(SWT.ICON_ERROR);%0A    Image iconWarning = display.getSystemImage(SWT.ICON_WARNING);%0A%0A    new SquareButton.SquareButtonBuilder()%0A            .setImage(iconInformation)%0A            .setImagePosition(SquareButton.ImagePosition.LEFT_OF_TEXT)%0A            .setText(%22This button provides you with some information.%22)%0A            .setParent(composite)%0A            .build();%0A%0A    new SquareButton.SquareButtonBuilder()%0A            .setImage(iconWarning)%0A            .setImagePosition(SquareButton.ImagePosition.LEFT_OF_TEXT)%0A            .setText(%22You should be cautious clicking this button.%22)%0A            .setParent(composite)%0A            .build(
 );%0A
+%0A
     
-popTartButton.setText(%22This button is contained in the PopTart%22
+new SquareButton.SquareButtonBuilder()%0A            .setImage(iconError)%0A            .setImagePosition(SquareButton.ImagePosition.LEFT_OF_TEXT)%0A            .setText(%22This button will produce an error.%22)%0A            .setParent(composite)%0A            .build();%0A%0A    new SquareButton.SquareButtonBuilder()%0A            .setImage(iconError)%0A            .setImagePosition(SquareButton.ImagePosition.LEFT_OF_TEXT)%0A            .setText(%22This button is bad news.%22)%0A            .setParent(composite)%0A            .build(
 );%0A%0A

Make PopTartExample more complex.