本文整理汇总了Java中com.google.gwt.user.client.ui.Panel类的典型用法代码示例。如果您正苦于以下问题:Java Panel类的具体用法?Java Panel怎么用?Java Panel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于com.google.gwt.user.client.ui包,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildPropertiesPanel
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
private Panel buildPropertiesPanel() {
// Team panel.
final ScrollPanel scrollTeamPanel = new ScrollPanel();
scrollTeamPanel.addStyleName(CSS_SCROLL);
scrollTeamPanel.add(buildTeamPanel());
// Main panel.
final HorizontalPanel panel = new HorizontalPanel();
panel.addStyleName(CSS_PROPS);
panel.add(buildVersionPanel());
panel.add(scrollTeamPanel);
return panel;
}
示例2: setPageViewCarrier
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
@Override
public void setPageViewCarrier(PageViewCarrier pageViewCarrier) {
view.getTitlePanel().clear();
view.getTitlePanel().add(pageViewCarrier.getPageTitle());
if (pageViewCarrier.hasContent()) {
Panel contentPanel = new FlowPanel();
if (pageViewCarrier.pageType == PageType.ERROR) {
contentPanel.setStyleName(styleNames.QP_PAGE_ERROR());
Label errorLabel = new Label(pageViewCarrier.errorMessage);
errorLabel.setStyleName(styleNames.QP_PAGE_ERROR_TEXT());
contentPanel.add(errorLabel);
}
view.getItemsPanel().clear();
view.getItemsPanel().add(contentPanel);
}
}
示例3: onClick
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
@Override
protected void onClick() {
setActive(!isActive());
if (!attached) {
volumeScrollBar.getElement().getStyle().setPosition(Position.ABSOLUTE);
((Panel) getParent()).add(volumeScrollBar);
attached = true;
}
changeStyleForClick();
if (isActive()) {
volumeScrollBar.setVisible(true);
int width = volumeScrollBar.getElement().getAbsoluteRight() - volumeScrollBar.getElement().getAbsoluteLeft();
width = getElement().getAbsoluteRight() - getElement().getAbsoluteLeft() - width;
volumeScrollBar.getElement().getStyle().setLeft(getElement().getAbsoluteLeft() + width / 2, Unit.PX);
int height = volumeScrollBar.getElement().getAbsoluteBottom() - volumeScrollBar.getElement().getAbsoluteTop();
volumeScrollBar.getElement().getStyle().setTop(getElement().getAbsoluteTop() - height, Unit.PX);
} else {
volumeScrollBar.setVisible(false);
}
}
示例4: initAppTitle
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the app's title section
* @param container The container that title resides
*/
private void initAppTitle(Panel container) {
if (newOrUpdateApp()) {
// GUI for editable title container
if (editStatus==NEWAPP) {
// If it's new app, give a textual hint telling user this is title
titleText.setText(app.getTitle());
} else if (editStatus==UPDATEAPP) {
// If it's not new, just set whatever's in the data field already
titleText.setText(app.getTitle());
}
titleText.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
app.setTitle(titleText.getText());
}
});
titleText.addStyleName("app-desc-textarea");
container.add(titleText);
container.addStyleName("app-title-container");
} else {
Label title = new Label(app.getTitle());
title.addStyleName("app-title");
container.add(title);
}
}
示例5: initAppDesc
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the app's description
* @param c1 The container that description resides (editable state)
* @param c2 The container that description resides (public state)
*/
private void initAppDesc(Panel c1, Panel c2) {
desc.getElement().setPropertyString("placeholder", MESSAGES.galleryDescriptionHint());
if (newOrUpdateApp()) {
desc.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
app.setDescription(desc.getText());
}
});
if(editStatus==UPDATEAPP){
desc.setText(app.getDescription());
}
desc.addStyleName("app-desc-textarea");
c1.add(desc);
} else {
Label description = new Label(app.getDescription());
c2.add(description);
c2.addStyleName("app-description");
}
}
示例6: initSalvageSection
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the salvage section
* @param container The container that salvage label reside
*/
private void initSalvageSection(Panel container) { //TODO: Update the location of this button
if (!canSalvage()) { // Permitted to salvage?
return;
}
final Label salvagePrompt = new Label("salvage");
salvagePrompt.addStyleName("primary-link");
container.add(salvagePrompt);
salvagePrompt.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final OdeAsyncCallback<Void> callback = new OdeAsyncCallback<Void>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Void bool) {
salvagePrompt.setText("done");
}
};
Ode.getInstance().getGalleryService().salvageGalleryApp(app.getGalleryAppId(), callback);
}
});
}
示例7: attachLogPanel
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/** Reveals the log div, and executes a task when done. */
// The async API for this method is intended to support two things: a cool
// spew animation, and also the potential to runAsync the whole LogPanel code.
private static void attachLogPanel() {
Logs.get().addHandler(domLogger);
final Panel logHolder = RootPanel.get("logHolder");
logHolder.setVisible(true);
// Need one layout and paint cycle after revealing it to start animation.
// Use high priority to avoid potential starvation by other tasks if a
// problem is occurring.
SchedulerInstance.getHighPriorityTimer().scheduleDelayed(new Task() {
@Override
public void execute() {
logHolder.add(domLogger);
Style waveStyle = Document.get().getElementById(WAVEPANEL_PLACEHOLDER).getStyle();
Style logStyle = logHolder.getElement().getStyle();
logStyle.setHeight(250, Unit.PX);
waveStyle.setBottom(250, Unit.PX);
}
}, 50);
}
示例8: createEditor
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/** Util to help construct an editor instance. */
private EditorImpl createEditor(KeyBindingRegistry keyBinding) {
EditorStaticDeps.setPopupProvider(new PopupProvider() {
@Override
public UniversalPopup createPopup(Element reference, RelativePopupPositioner positioner,
PopupChrome chrome, boolean autoHide) {
return new Popup(reference, positioner);
}
@Override
public void setRootPanel(Panel rootPanel) {
// Not used as we use our own popup implementation.
}
});
Editor editor = Editors.create();
initEditor(editor, Editor.ROOT_REGISTRIES, keyBinding);
return (EditorImpl) editor;
}
示例9: createPanel
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
private Panel createPanel() {
Label label = new Label("Search Options");
label.addStyleName("search-header");
label.getElement().getStyle().setDisplay(Display.BLOCK);
Grid grid = new Grid(2,2);
grid.setText(0, 0, "Ontology/Codelist:");
grid.setWidget(0, 1, ontologiesDropBox);
grid.setText(1, 0, "Include Synonyms:");
grid.setWidget(1, 1, includeSynonyms);
grid.addStyleName("search-options");
CellFormatter cellFormatter = grid.getCellFormatter();
for(int i = 0; i < grid.getRowCount(); i++) {
cellFormatter.addStyleName(i, 0, "search-option");
}
Panel panel = new FlowPanel();
panel.add(label);
panel.add(grid);
return panel;
}
示例10: makeFixedSizeContainer
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
public Panel makeFixedSizeContainer(int width, int height, boolean decorated) {
SimplePanel panel= new SimplePanel();
panel.setWidget(this);
panel.setPixelSize(width,height);
Panel retval= panel;
if (decorated) {
DecoratorPanel dp= new DecoratorPanel();
dp.setWidget(panel);
retval= dp;
}
return retval;
}
示例11: makeFailureMessage
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
public Panel makeFailureMessage(String message, int width, int height, boolean decorated) {
VerticalPanel panel= new VerticalPanel();
HTML header = new HTML(getTitle());
Widget msg = GwtUtil.centerAlign(new HTML(message));
header.addStyleName("preview-title");
GwtUtil.setStyle(msg, "padding", "5px");
panel.add(header);
panel.add(msg);
panel.setPixelSize(width, height);
Panel retval= panel;
if (decorated) {
DecoratorPanel dp= new DecoratorPanel();
dp.setWidget(panel);
retval= dp;
}
return retval;
}
示例12: addTab
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
public void addTab(TabPane<Panel> tabs) {
FlowPanel fp= new FlowPanel();
fp.add(urlField);
fp.add(multiAction);
fp.add(ext);
GwtUtil.setStyle(urlField, "padding", "20px 0 25px 30px");
tabs.addTab(fp, _prop.getTitle("url"));
GwtUtil.setHidden(ext,multiAction.getField().getValue().equals("loadAll"));
multiAction.getField().addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
GwtUtil.setHidden(ext, multiAction.getField().getValue().equals("loadAll"));
}
});
}
示例13: onChannelMessage
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
@Override
public void onChannelMessage(Object p_message)
{
// redraw widget according to new presenceRoom
PresenceRoom newPresenceRoom = (PresenceRoom)p_message;
m_panel.clear();
Set<String> pseudoList = new HashSet<String>();
for( Presence presence : newPresenceRoom )
{
if( !pseudoList.contains( presence.getPseudo() ) )
{
pseudoList.add( presence.getPseudo() );
Panel panel = new HorizontalPanel();
Image image = new Image( presence.getAvatarUrl() );
image.setPixelSize( 32, 32 );
image.setAltText( presence.getPseudo() );
image.setTitle( presence.getPseudo() );
panel.add( image );
panel.add( new Label(presence.getPseudo()) );
m_panel.add( panel );
}
}
}
示例14: MAppChat
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
public MAppChat()
{
m_panel.setSize( "100%", "100%" );
scrollPanel.setHeight( "400px" );
m_msgList.setStyleName( "msglist" );
scrollPanel.add( m_msgList );
m_panel.add( scrollPanel );
Panel hpanel = new HorizontalPanel();
hpanel.setSize( "100%", "100%" );
hpanel.add( m_text );
m_text.setWidth( "100%" );
m_text.addKeyDownHandler( this );
hpanel.add( m_btnOk );
m_btnOk.addClickHandler( this );
m_panel.add( hpanel );
initWidget( m_panel );
}
示例15: swap
import com.google.gwt.user.client.ui.Panel; //导入依赖的package包/类
/**
* Swaps a TextBox with an element of the same type for remember password. The text box needs to be within an panel. The styles of the text box are also
* copied
*
* @param textBox
* @param elementId
* @return
*/
@SuppressWarnings("unchecked")
public static <T extends TextBox> T swap (T textBox, String elementId) {
Panel parent = (Panel) textBox.getParent();
T newTextBox = null;
if (textBox instanceof PasswordTextBox) {
newTextBox = (T) PasswordTextBox
.wrap(DOM.getElementById(elementId));
} else if (textBox instanceof TextBox) {
newTextBox = (T) TextBox.wrap(DOM.getElementById(elementId));
}
newTextBox.getElement().setAttribute("class",
textBox.getElement().getAttribute("class"));
newTextBox.removeFromParent();
parent.getElement().insertBefore(newTextBox.getElement(),
textBox.getElement());
textBox.removeFromParent();
return newTextBox;
}