Java Code Examples for com.google.gwt.user.client.ui.AbsolutePanel#setStylePrimaryName()

The following examples show how to use com.google.gwt.user.client.ui.AbsolutePanel#setStylePrimaryName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MockMap.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
public MockMap(SimpleEditor editor) {
  super(editor, TYPE, images.map(), new MockMapLayout());
  initToolbarItems();

  rootPanel.setHeight("100%");

  mapWidget = new AbsolutePanel();
  mapWidget.setStylePrimaryName("ode-SimpleMockContainer");
  mapWidget.add(rootPanel);

  initComponent(mapWidget);
  mapWidget.addAttachHandler(new AttachEvent.Handler() {
    @Override
    public void onAttachOrDetach(AttachEvent arg0) {
      if (arg0.isAttached()) {
        initPanel();
        invalidateMap();
        for (MockComponent child : children) {
          ((MockMapFeature) child).addToMap(MockMap.this);
        }
      }
    }
  });
}
 
Example 2
Source File: MockCanvas.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new MockCanvas component.
 *
 * @param editor editor of source file the component belongs to
 */
public MockCanvas(SimpleEditor editor) {
  super(editor, TYPE, images.canvas(), new MockCanvasLayout());

  rootPanel.setHeight("100%");

  canvasWidget = new AbsolutePanel();
  canvasWidget.setStylePrimaryName("ode-SimpleMockContainer");
  canvasWidget.add(rootPanel);

  initComponent(canvasWidget);
}
 
Example 3
Source File: MockTableArrangement.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new MockTableArrangement component.
 *
 * @param editor  editor of source file the component belongs to
 */
public MockTableArrangement(SimpleEditor editor) {
  super(editor, TYPE, images.table(), new MockTableLayout());

  rootPanel.setHeight("100%");

  layoutWidget = new AbsolutePanel();
  layoutWidget.setStylePrimaryName("ode-SimpleMockContainer");
  layoutWidget.add(rootPanel);

  initComponent(layoutWidget);
}
 
Example 4
Source File: MockForm.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new MockForm component.
 *
 * @param editor  editor of source file the component belongs to
 */
public MockForm(SimpleEditor editor) {
  // Note(Hal): This helper thing is a kludge because I really want to write:
  // myLayout = new MockHVLayout(orientation);
  // super(editor, type, icon, myLayout);
  // but Java won't let me do that.

  super(editor, TYPE, images.form(), MockFormHelper.makeLayout());
  // Note(hal): There better not be any calls to MockFormHelper before the
  // next instruction.  Note that the Helper methods are synchronized to avoid possible
  // future problems if we ever have threads creating forms in parallel.
  myLayout = MockFormHelper.getLayout();

  phoneWidget = new AbsolutePanel();
  phoneWidget.setStylePrimaryName("ode-SimpleMockFormPhonePortrait");
  formWidget = new AbsolutePanel();
  formWidget.setStylePrimaryName("ode-SimpleMockForm");
  responsivePanel = new AbsolutePanel();

  // Initialize mock form UI by adding the phone bar and title bar.
  responsivePanel.add(new PhoneBar());
  titleBar = new TitleBar();
  responsivePanel.add(titleBar);

  // Put a ScrollPanel around the rootPanel.
  scrollPanel = new ScrollPanel(rootPanel);
  responsivePanel.add(scrollPanel);

  formWidget.add(responsivePanel);

  //Add navigation bar at the bottom of the viewer.
  navigationBar = new NavigationBar();
  formWidget.add(navigationBar);

  phoneWidget.add(formWidget);
  initComponent(phoneWidget);

  // Set up the initial state of the vertical alignment property editor and its dropdowns
  try {
    myVAlignmentPropertyEditor = PropertiesUtil.getVAlignmentEditor(properties);
  } catch (BadPropertyEditorException e) {
    OdeLog.log(MESSAGES.badAlignmentPropertyEditorForArrangement());
    return;
  }
  enableAndDisableDropdowns();
  initialized = true;
  // Now that the default for Scrollable is false, we need to force setting the property when creating the MockForm
  setScrollableProperty(getPropertyValue(PROPERTY_NAME_SCROLLABLE));
}