本文整理汇总了Java中com.google.gwt.event.logical.shared.BeforeSelectionHandler类的典型用法代码示例。如果您正苦于以下问题:Java BeforeSelectionHandler类的具体用法?Java BeforeSelectionHandler怎么用?Java BeforeSelectionHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeforeSelectionHandler类属于com.google.gwt.event.logical.shared包,在下文中一共展示了BeforeSelectionHandler类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TextWord
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public TextWord(PlatformContext context, WordPresenter presenter,
FileModel fmodel) {
super(context, presenter);
this.model = fmodel;
if (fmodel.isAdmin() || context.getUser().isSuper()) {
add(getEditTab(), new TabItemConfig("编辑", false));
} else {
add(getViewTab(), new TabItemConfig("查看", false));
}
addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() {
public void onBeforeSelection(BeforeSelectionEvent<Widget> event) {
if (event.getItem() == getViewTab()) {
if (editTab.getNewContent() != null) {
getViewTab().refresh(editTab.getNewContent());
} else if (model.getContent() != null) {
getViewTab().refresh(model.getContent());
}
} else if (event.getItem() == getEditTab()) {
getEditTab().getCodeMirror().refresh();
}
}
});
}
示例2: asWidget
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
/**
* @return this editor as a Widget.
*/
public Widget asWidget() {
VerticalPanel panel = new VerticalPanel();
panel.add(new ContentGroupLabel(Singleton.MESSAGES.label_serviceDetails()));
panel.add(new ContentDescription(Singleton.MESSAGES.description_serviceDetails()));
panel.add(createImplementationDetailsPanel());
TabPanel tabs = new TabPanel();
tabs.setStyleName("default-tabpanel"); //$NON-NLS-1$
tabs.getElement().setAttribute("style", "margin-top:15px;"); //$NON-NLS-1$ //$NON-NLS-2$
tabs.add(createGatewayDetailsPanel(), Singleton.MESSAGES.label_gateways());
tabs.add(createThrottlingDetailsPanel(), Singleton.MESSAGES.label_throttling());
tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
@Override
public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
_toolstrip.doCancel();
}
});
panel.add(tabs);
tabs.selectTab(0);
return panel;
}
示例3: ShellWord
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public ShellWord(PlatformContext context,WordPresenter presenter,FileModel fmodel) {
super(context ,presenter);
this.model=fmodel;
if(fmodel.isAdmin() || context.getUser().isSuper()){
add(getEditTab(), new TabItemConfig("编辑", false));
add(getHistoryTab(),new TabItemConfig("调试历史", false));
setActiveWidget(editTab);
}else{
add(getViewTab(), new TabItemConfig("查看", false));
}
addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() {
public void onBeforeSelection(
BeforeSelectionEvent<Widget> event) {
if (event.getItem() == getViewTab()) {
if(editTab.getNewContent()!=null){
getViewTab().refresh(editTab.getNewContent());
}else if (model.getContent() != null) {
getViewTab().refresh(model.getContent());
}
}else if(event.getItem()==getEditTab()){
getEditTab().getCodeMirror().refresh();
}else if(event.getItem() == getHistoryTab()){
getHistoryTab().refresh();
}
}
});
}
示例4: HiveWord
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public HiveWord(PlatformContext context, WordPresenter presenter,
FileModel fmodel) {
super(context, presenter);
this.model = fmodel;
if (fmodel.isAdmin() || context.getUser().isSuper()) {
add(getEditTab(), new TabItemConfig("编辑", false));
add(getHistoryTab(), new TabItemConfig("调试历史", false));
setActiveWidget(editTab);
} else {
add(getViewTab(), new TabItemConfig("查看", false));
}
addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() {
@Override
public void onBeforeSelection(BeforeSelectionEvent<Widget> event) {
if (event.getItem() == getViewTab()) {
if (editTab.getNewContent() != null) {
getViewTab().refresh(editTab.getNewContent());
} else if (model.getContent() != null) {
getViewTab().refresh(model.getContent());
}
} else if (event.getItem() == getEditTab()) {
getEditTab().getCodeMirror().refresh();
} else if (event.getItem() == getHistoryTab()) {
getHistoryTab().refresh();
}
}
});
}
示例5: makeUI
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public void makeUI() {
spacialOpsTabs.addSelectionHandler(new SelectionHandler<Integer>() {
public void onSelection(SelectionEvent<Integer> event) {
if (tabUpdateOn) updateSelectedTab();
}
});
spacialOpsTabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
public void onBeforeSelection(BeforeSelectionEvent<Integer> ev) {
preSelectedTab(ev.getItem());
}
});
makeSingle();
makeIbeSingle();
makeMulti();
makeIbeMulti();
makePolygon();
makeAllSky();
reinitTabPane(true, true, true, true, true, true);
mainPanel.add(spacialOpsTabs);
spacialOpsTabs.setSize("100%", "100%");
// mainPanel.setSize("700px", "245px");
mainPanel.setSize("600px", NORMAL_HEIGHT_REQUIRED+"px");
GwtUtil.setStyle(mainPanel,"paddingTop", PADDING_TOP+"px");
}
示例6: PreferencePanel
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public PreferencePanel() {
//populatePreferences();
String[] items = WebProp.getItems(PROP_BASE);
groupPanels = new PrefGroupPanel[items.length];
int idx = 0;
for (String s : items) {
// construct tab
String title = WebProp.getTitle(PROP_BASE+"."+s);
groupPanels[idx] = new PrefGroupPanel(PROP_BASE+"."+s+".field");
tabs.addTab(groupPanels[idx], title);
idx++;
}
panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
panel.add(grid);
panel.addStyleName("content-panel");
WebAppProperties wap = Application.getInstance().getProperties();
hasViewAll = wap.getBooleanProperty(PROP_BASE+".hasViewAll");
if (hasViewAll) {
tabs.addTab(panel, "View All");
}
// make sure preference view is in sync with the latest updates
tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
public void onBeforeSelection(BeforeSelectionEvent<Integer> ev) {
int tabIndex= ev.getItem();
if (hasViewAll && tabIndex == tabs.getWidgetCount()-1) {
populatePreferences();
}
lastTab = tabIndex;
}
});
tabs.setSize("99%", "99%");
tabs.selectTab(0);
initWidget(tabs);
}
示例7: onRender
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
topStatistics.setWidth("100%");
topStatistics.setHeight("30");
topDate.setHeight("30");
searchconditions.setWidth("100%");
add(topStatistics);
add(getTopDate());
add(searchconditions);
searchconditions.setHorizontalAlignment(searchconditions.ALIGN_CENTER);
tabPanel.setWidth("100%");
tabPanel.setAnimationEnabled(true);
tabPanel.add(orderReportPanel , "订单概况");
tabPanel.add(shippingReportPanel , "配送方式");
tabPanel.add(payReportPanel , "支付方式");
tabPanel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
public void onBeforeSelection(BeforeSelectionEvent<Integer> sender) {
int tabIndex = sender.getItem();
if(tabIndex == 0){
setOrderReportPanel();
}else if(tabIndex == 1){
setShippingReportPanel();
}else if(tabIndex == 2){
setPayReportPanel();
}else{
System.out.println("Error in tab select");
}
}
});
searchconditions.add(tabPanel);
}
示例8: addBeforeSelectionHandler
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Node> handler) {
return ensureHandlers().addHandler(BeforeSelectionEvent.getType(), handler);
}
示例9: addBeforeSelectionHandler
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Integer> h) {
return tabPanel.addBeforeSelectionHandler(h);
}
示例10: addBeforeSelectionHandler
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Integer> handler) {
return addHandler(handler, BeforeSelectionEvent.getType());
}
示例11: addBeforeSelectionHandler
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
@Override
public HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler<PartDefinition> handler) {
return addHandler(handler,
BeforeSelectionEvent.getType());
}
示例12: addBeforeSelectionHandler
import com.google.gwt.event.logical.shared.BeforeSelectionHandler; //导入依赖的package包/类
public HandlerRegistration addBeforeSelectionHandler(
BeforeSelectionHandler<Integer> handler) {
return addHandler(handler, BeforeSelectionEvent.getType());
}