當前位置: 首頁>>代碼示例>>Java>>正文


Java Panel類代碼示例

本文整理匯總了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;

	}
 
開發者ID:sigmah-dev,項目名稱:sigmah,代碼行數:18,代碼來源:CreditsView.java

示例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);
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:19,代碼來源:PageViewSocketImpl.java

示例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);
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:22,代碼來源:VolumeMediaButton.java

示例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);
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:30,代碼來源:GalleryPage.java

示例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");
  }
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:26,代碼來源:GalleryPage.java

示例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);
    }
  });
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:28,代碼來源:GalleryPage.java

示例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);
}
 
開發者ID:ArloJamesBarnes,項目名稱:walkaround,代碼行數:23,代碼來源:Walkaround.java

示例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;
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:18,代碼來源:KeyBindingRegistryIntegrationGwtTest.java

示例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;
}
 
開發者ID:Novartis,項目名稱:ontobrowser,代碼行數:23,代碼來源:SearchOptionsView.java

示例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;

    }
 
開發者ID:lsst,項目名稱:firefly,代碼行數:17,代碼來源:MiniPlotWidget.java

示例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;
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:20,代碼來源:MiniPlotWidget.java

示例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"));
        }
    });

}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:21,代碼來源:ImageSelectDialogTypes.java

示例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 );
    }
  }
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:24,代碼來源:MAppPresences.java

示例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 );
}
 
開發者ID:kroc702,項目名稱:fullmetalgalaxy,代碼行數:21,代碼來源:MAppChat.java

示例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;
}
 
開發者ID:billy1380,項目名稱:blogwt,代碼行數:31,代碼來源:UiHelper.java


注:本文中的com.google.gwt.user.client.ui.Panel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。