当前位置: 首页>>代码示例>>Java>>正文


Java CenterPopupPositioner类代码示例

本文整理汇总了Java中org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner的典型用法代码示例。如果您正苦于以下问题:Java CenterPopupPositioner类的具体用法?Java CenterPopupPositioner怎么用?Java CenterPopupPositioner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CenterPopupPositioner类属于org.waveprotocol.wave.client.widget.popup包,在下文中一共展示了CenterPopupPositioner类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UploadFormPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Creates an upload popup.
 */
public UploadFormPopup() {
  form = BINDER.createAndBindUi(this);

  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  chrome.enableTitleBar();
  popup = PopupFactory.createPopup(null, new CenterPopupPositioner(), chrome, false);
  popup.getTitleBar().setTitleText("Upload attachment");
  popup.add(form);

  iframe = Document.get().createIFrameElement();
  iframe.setName("_uploadform" + iframeId++);
  // HACK(danilatos): Prevent browser from caching due to whatever reason
  iframe.setSrc("/uploadform?nocache=" + Duration.currentTimeMillis());
  form.getElement().setAttribute("target", iframe.getName());

  onloadRegistration =
      DomHelper.registerEventHandler(iframe, "load", new JavaScriptEventListener() {
        @Override
        public void onJavaScriptEvent(String name, Event event) {
          onIframeLoad();
        }
      });
  UIObject.setVisible(iframe, false);
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:28,代码来源:UploadFormPopup.java

示例2: getNotSavedDialogActivator

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Creates a dialogBox that informs about not saved data.
 */
private DialogActivator getNotSavedDialogActivator() {
  if (notSavedDialogActivator == null) {
    PopupChrome chrome = PopupChromeFactory.createPopupChrome();
    UniversalPopup popup = PopupFactory.createPopup(Document.get().getElementById(APP_ELEMENT_ID),
        new CenterPopupPositioner(), chrome, false);

    Label messageLabel = new Label(messages.changesNotSavedMessage());
    messageLabel.setStyleName(Dialog.getCss().infoLabel());

    DialogBox.create(popup, messages.changesNotSavedTitle(), messageLabel,
        new DialogButton[] { notSavedDialogNo, notSavedDialogYes });

    notSavedDialogActivator = new DialogActivator(popup);
  }
  return notSavedDialogActivator;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:20,代码来源:WebClient.java

示例3: showInPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Shows in a popup, and returns the popup.
 */
public UniversalPopup showInPopup() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  UniversalPopup popup = PopupFactory.createPopup(
      RootPanel.getBodyElement(), new CenterPopupPositioner(), chrome, true);
  popup.addPopupEventListener(new PopupEventListener.Impl() {

    @Override
    public void onHide(PopupEventSourcer source) {
      hide();
    }      
  });

  TitleBar titleBar = popup.getTitleBar();
  titleBar.setTitleText(messages.selectGadget());
  popup.add(GadgetSelectorWidget.this);

  popup.show();

  setFocusAndHeight();
  setupEventHandlers();

  return popup;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:27,代码来源:GadgetSelectorWidget.java

示例4: information

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Standard information dialog with prompt and "OK" button.
 *
 * @param message message to display
 */
public static void information(String message) {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  final UniversalPopup popup = PopupFactory.createPopup(RootPanel.getBodyElement(),
      new CenterPopupPositioner(), chrome, true);

  VerticalPanel verticalPanel = new VerticalPanel();
  verticalPanel.setStyleName(Dialog.getCss().verticalPanel());
  Label label = new Label(message);
  verticalPanel.add(label);

  DialogButton okButton = new DialogButton(messages.ok(), new Command() {

    @Override
    public void execute() {
      popup.hide();
    }
  });

  DialogBox.create(popup, messages.confirmation(), verticalPanel,
      new DialogButton[] { okButton });

  popup.show();
  requestFocus(okButton.getButton());
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:30,代码来源:DialogBox.java

示例5: showInPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Shows in a popup, and returns the popup.
 */
public UniversalPopup showInPopup() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  UniversalPopup popup = PopupFactory.createPopup(
      null, new CenterPopupPositioner(), chrome, true);

  TitleBar titleBar = popup.getTitleBar();
  titleBar.setTitleText(messages.selectGadget());
  popup.add(GadgetSelectorWidget.this);

  popup.show();

  setFocusAndHeight();
  setupEventHandlers();

  return popup;
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:20,代码来源:GadgetSelectorWidget.java

示例6: showInPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Shows in a popup, and returns the popup.
 * @param user the logged in user. The popup does not show it but makes sure it is
 *             in the participant set returned
 */
public UniversalPopup showInPopup(ParticipantId user, Set<ParticipantId> participants,
    ProfileManager profiles) {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  UniversalPopup popup = PopupFactory.createPopup(
      RootPanel.getBodyElement(), new CenterPopupPositioner(), chrome, true);

  TitleBar titleBar = popup.getTitleBar();
  titleBar.setTitleText("Select participants");
  popup.add(ParticipantSelectorWidget.this);

  this.user = user;
  this.participants = new HashSet<ParticipantId>(participants);
  this.profiles = profiles;

  // If there is only one participant, create the wave without showing the popup
  if (participants.size() == 1) {
    if (listener != null) {
      listener.onSelect(participants);
    }
    return popup;
  }

  createParticipantList(participants);
  popup.show();
  setFocusAndHeight();

  return popup;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:34,代码来源:ParticipantSelectorWidget.java

示例7: confirm

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Standard confirmation dialog with prompt, "OK" and "Cancel" buttons.
 *
 * @param message message to display
 * @param okCommand command to be executed if OK button is pressed
 */
public static void confirm(String message, final Command okCommand) {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  final UniversalPopup popup = PopupFactory.createPopup(RootPanel.getBodyElement(),
      new CenterPopupPositioner(), chrome, true);

  VerticalPanel verticalPanel = new VerticalPanel();
  verticalPanel.setStyleName(Dialog.getCss().verticalPanel());
  Label label = new Label(message);
  verticalPanel.add(label);

  DialogButton okButton = new DialogButton(messages.ok(), new Command() {

    @Override
    public void execute() {
      popup.hide();
      if (okCommand != null) {
        okCommand.execute();
      }
    }
  });

  DialogBox.create(popup, messages.confirmation(), verticalPanel,
      new DialogButton[] { okButton, createCancelButton(popup) });

  popup.show();
  requestFocus(okButton.getButton());
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:34,代码来源:DialogBox.java

示例8: createTurbulencePopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/** Creates a popup that warns about network disconnects. */
private static UniversalPopup createTurbulencePopup() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  UniversalPopup popup =
      PopupFactory.createPopup(null, new CenterPopupPositioner(), chrome, true);
  popup.add(new HTML("<div style='color: red; padding: 5px; text-align: center;'>"
      + "<b>" + messages.turbulenceDetected() + "<br></br> "
      + messages.saveAndReloadWave() + "</b></div>"));
  return popup;
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:11,代码来源:WebClient.java

示例9: showInPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
/**
 * Shows in a popup, and returns the popup.
 * @param user the logged in user. The popup does not show it but makes sure it is
 *             in the participant set returned
 */
public UniversalPopup showInPopup(ParticipantId user, Set<ParticipantId> participants,
    ProfileManager profiles) {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  UniversalPopup popup = PopupFactory.createPopup(
      null, new CenterPopupPositioner(), chrome, true);

  TitleBar titleBar = popup.getTitleBar();
  titleBar.setTitleText("Select participants");
  popup.add(ParticipantSelectorWidget.this);

  this.user = user;
  this.participants = new HashSet<ParticipantId>(participants);
  this.profiles = profiles;

  // If there is only one participant, create the wave without showing the popup
  if (participants.size() == 1) {
    if (listener != null) {
      listener.onSelect(participants);
    }
    return popup;
  }

  createParticipantList(participants);
  popup.show();
  setFocusAndHeight();

  return popup;
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:34,代码来源:ParticipantSelectorWidget.java

示例10: StatDialog

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
public StatDialog() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  popup = PopupFactory.createPopup(Document.get().getElementById(WebClient.APP_ELEMENT_ID),
      new CenterPopupPositioner(), chrome, true);
  htmlPanel = new HTMLPanel("");
  htmlPanel.addDomHandler(new ClickHandler(){

    @Override
    public void onClick(ClickEvent event) {
      Element e = event.getNativeEvent().getEventTarget().cast();
      if (e.getTagName().toLowerCase().equals("a")) {
        event.preventDefault();
        if (isClient) {
          if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
            Timing.setEnabled(!Timing.isEnabled());
            showClientStatistic();
          } else if (ID_CLEAR.equals(e.getId())) {
            Timing.clearStatistics();
            showClientStatistic();
          }
        } else {
          String href = e.getPropertyString("href");
          int index = href.lastIndexOf('/');
          if (index != -1) {
            showUrl(StatService.STAT_URL + href.substring(index+1));
          }
        }
      }
    }
  }, ClickEvent.getType());

  ScrollPanel scroll = new ScrollPanel(htmlPanel);
  scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
      RootPanel.get().getOffsetHeight()-200 + "px");
  targetButton = new DialogButton("", new Command() {

    @Override
    public void execute() {
      if (isClient) {
        showServerStatistic();
      } else {
        showClientStatistic();
      }
    }
  });
  exitButton = new DialogButton("Exit", new Command() {

    @Override
    public void execute() {
      popup.hide();
    }
  });
  DialogBox.create(popup, "", scroll, new DialogButton[] { targetButton, exitButton });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:55,代码来源:StatDialog.java

示例11: setupErrorPopup

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
private void setupErrorPopup() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  errorPopup = PopupFactory.createPopup(waveHolder.getElement(),
      new CenterPopupPositioner(), chrome, true);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:6,代码来源:WebClient.java

示例12: showDialog

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
private void showDialog(final Command onDone) {
  exitAllowed = false;
  saveDraft = false;

  final UniversalPopup popup = PopupFactory.createPopup(RootPanel.getBodyElement(),
          new CenterPopupPositioner(), PopupChromeFactory.createPopupChrome(), false);
  popup.setMaskEnabled(true);
  DialogButton[] buttons = {
    new DialogButton(messages.save(), new Command() {
      @Override
      public void execute() {
        popup.hide();
        exitAllowed = true;
        saveDraft = true;
        onDone.execute();
      }
    }),

    new DialogButton(messages.discard(), new Command() {
      @Override
      public void execute() {
        popup.hide();
        exitAllowed = true;
        saveDraft = false;
        onDone.execute();
      }
    }),

    new DialogButton(messages.continueEditing(), new Command() {

      @Override
      public void execute() {
        popup.hide();
        exitAllowed = false;
        saveDraft = true;
        onDone.execute();
      }
    })
  };
  DialogBox.create(popup, messages.saveDraft(), new Label(messages.saveDraft()), buttons);
  popup.show();
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:43,代码来源:InteractiveEditSessionFinisher.java

示例13: StatDialog

import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner; //导入依赖的package包/类
public StatDialog() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  popup = PopupFactory.createPopup(
      Document.get().getElementById("app"), new CenterPopupPositioner(), chrome, true);
  htmlPanel = new HTMLPanel("");
  htmlPanel.addDomHandler(new ClickHandler(){

    @Override
    public void onClick(ClickEvent event) {
      Element e = event.getNativeEvent().getEventTarget().cast();
      if (e.getTagName().toLowerCase().equals("a")) {
        event.preventDefault();
        if (isClient) {
          if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
            Timing.setEnabled(!Timing.isEnabled());
            showClientStatistic();
          } else if (ID_CLEAR.equals(e.getId())) {
            Timing.clearStatistics();
            showClientStatistic();
          }
        } else {
          String href = e.getPropertyString("href");
          int index = href.lastIndexOf('/');
          if (index != -1) {
            showUrl(StatService.STAT_URL + href.substring(index+1));
          }
        }
      }
    }
  }, ClickEvent.getType());

  ScrollPanel scroll = new ScrollPanel(htmlPanel);
  scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
          RootPanel.get().getOffsetHeight()-200 + "px");
  targetButton = new DialogBox.DialogButton("", new Command() {

    @Override
    public void execute() {
      if (isClient) {
        showServerStatistic();
      } else {
        showClientStatistic();
      }
    }
  });
  exitButton = new DialogBox.DialogButton("Exit", new Command() {

    @Override
    public void execute() {
      popup.hide();
    }
  });
  DialogBox.create(popup, "", scroll,
      new DialogBox.DialogButton[] { targetButton, exitButton });
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:56,代码来源:StatDialog.java


注:本文中的org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。