org.apache.wicket.markup.html.panel.Fragment.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.apache.wicket.markup.html.panel.Fragment.<init>()方法的一些代码示例,展示了Fragment.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.<init>()方法的具体详情如下:
包路径:org.apache.wicket.markup.html.panel.Fragment
类名称:Fragment
方法名:<init>

Fragment.<init>介绍

[英]Constructor.
[中]构造器。

代码示例

代码示例来源:origin: stackoverflow.com

@Override
public Fragment getItem(int position) {
  switch (position) {
    case 0: // Fragment # 0 - This will show FirstFragment
      return FirstFragment.newInstance(0, "Page # 1");
    case 1: // Fragment # 0 - This will show FirstFragment different title
      return FirstFragment.newInstance(1, "Page # 2");
    case 2:
      return FirstFragment.newInstance(2, "Page # 3");
    default:
      return new Fragment();
  }
}

代码示例来源:origin: stackoverflow.com

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if (savedInstanceState == null) {
    // Add the fragment on initial activity setup
    mainFragment = new Fragment();
    getSupportFragmentManager().beginTransaction()
    .add(android.R.id.content, mainFragment).commit();
  } else {
    // Or set the fragment from restored state info
    mainFragment = (Fragment) getSupportFragmentManager()
        .findFragmentById(android.R.id.content);
  }

}

代码示例来源:origin: stackoverflow.com

Fragment fragment = new Fragment();
Bundle bundle = new Bundle();
bundle.putInt(key, value);
fragment.setArguments(bundle);

代码示例来源:origin: stackoverflow.com

FragmentTransaction ft = fragmentManager.beginTransaction();

Fragment fragment1 = new Fragment();
ft.add(R.id.llContainer, fragment1, "fragment_one");

Fragment fragment2 = new Fragment();
ft.add(R.id.llContainer, fragment2, "fragment_two");

ft.commit();

代码示例来源:origin: stackoverflow.com

@Override
public void onClick(View v) {
  final FragmentManager fm = ((FragmentActivity) getContext()).getSupportFragmentManager();
  Fragment auxiliary = new Fragment() {
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      //DO WHATEVER YOU NEED
      super.onActivityResult(requestCode, resultCode, data);
      fm.beginTransaction().remove(this).commit();
    }
  };
  fm.beginTransaction().add(auxiliary, "FRAGMENT_TAG").commit();
  fm.executePendingTransactions();

  auxiliary.startActivityForResult(new Intent(getContext(), ToStartActivity.class), 3333);
}

代码示例来源:origin: stackoverflow.com

@Override public void onItemClick(AdapterView<?> l, View v, int position, long id) {
 Fragment details = new Fragment();
 getChildFragmentManager()
   .beginTransaction()

代码示例来源:origin: stackoverflow.com

@Override
public boolean onOptionsItemSelected(MenuItem item) {
  final Fragment fragment;

  if (item.getTitle().equals(MAP)) {
    fragment = mMapFragment;
  } else { 
    fragment = new Fragment();
  } 

  Handler handler = new Handler();
  handler.post(new Runnable() {

    @Override
    public void run() {
      getFragmentManager()
      .beginTransaction()
      .replace(R.id.main, fragment)
      .addToBackStack(null)
      .commit();    
    }

  });     

  return true;
}

代码示例来源:origin: com.googlecode.wicket-jquery-ui/jquery-ui-core

/**
 * Gets a new {@link Fragment} containing the input<br/>
 * Overridden methods should provide a {@link Fragment} containing input(s) when no input(s) has been specified in implementation constructors.
 * @return the empty-fragment by default
 */
protected Fragment newInputFragment(String id)
{
  return new Fragment(id, "empty-fragment", this);
}

代码示例来源:origin: stackoverflow.com

Bundle bundle = new Bundle();
bundle.putString("key", "value");
// to send object use below code
// bundle.putSerializable("key", object);
Fragment fragment = new Fragment();
fragment.setArguments(bundle);
getSupportFragmentManager().beginTransaction().replace(R.id.container, fragment).commit();

代码示例来源:origin: stackoverflow.com

Fragment fragment = new Fragment();
Bundle bundle = new Bundle();
bundle.putInt(key, value);
fragment.setArguments(bundle);

代码示例来源:origin: theonedev/onedev

@Override
protected Component newContent(String id, FloatingPanel dropdown) {
  Fragment fragment = new Fragment(id, "navContextDropdownFrag", GroupPage.this);
  fragment.add(new Tabbable("menu", newTabs()));
  return fragment;
}

代码示例来源:origin: org.onehippo.cms7/hippo-addon-channel-manager-frontend

@Override
public Component getLabel() {
  Fragment fragment = new Fragment("label", "description", ChannelActionsPlugin.this);
  fragment.add(new Label("label", new StringResourceModel("label", ChannelActionsPlugin.this, null)));
  return fragment;
}

代码示例来源:origin: theonedev/onedev

@Override
public void populateItem(Item<ICellPopulator<PullRequest>> cellItem, String componentId, IModel<PullRequest> rowModel) {
  if (rowModel.getObject().getSource() != null) {
    Fragment fragment = new Fragment(componentId, "sourceFrag", IssuePullRequestsPanel.this);
    fragment.add(new BranchLink("link", rowModel.getObject().getSource(), rowModel.getObject()));
    cellItem.add(fragment);
  } else {
    cellItem.add(new Label(componentId, "<i>Unknown</i>").setEscapeModelStrings(false));
  }
}

代码示例来源:origin: org.geoserver.community/gs-geogig

protected Component headerPanel() {
    Fragment header = new Fragment(HEADER_PANEL, "header", this);

    header.add(new BookmarkablePageLink<String>("importExisting", RepositoryImportPage.class));
    header.add(new BookmarkablePageLink<String>("addNew", RepositoryEditPage.class));

    return header;
  }
}

代码示例来源:origin: theonedev/onedev

@Override
protected Component newHead(String componentId) {
  Fragment fragment = new Fragment(componentId, "sidebarHeadFrag", UserPage.this);
  User user = userModel.getObject();
  fragment.add(new UserAvatar("avatar", UserIdent.of(UserFacade.of(user))).add(AttributeAppender.append("title", user.getDisplayName())));
  fragment.add(new Label("name", user.getDisplayName()));
  return fragment;
}

代码示例来源:origin: org.geoserver.web/web-core

protected Component headerPanel() {
  Fragment header = new Fragment(HEADER_PANEL, "header", this);
  
  // the add button
  header.add(new BookmarkablePageLink("addNew", LayerGroupNewPage.class));
  
  // the removal button
  header.add(removal = new SelectionRemovalLink("removeSelected", table, dialog));
  removal.setOutputMarkupId(true);
  removal.setEnabled(false);
  
  return header;
}

代码示例来源:origin: org.geoserver.web/gs-web-core

protected Component headerPanel() {
  Fragment header = new Fragment(HEADER_PANEL, "header", this);
  // the add button
  header.add(new BookmarkablePageLink<Void>("addNew", NewLayerPage.class));
  // the removal button
  header.add(removal = new SelectionRemovalLink("removeSelected", table, dialog));
  removal.setOutputMarkupId(true);
  removal.setEnabled(false);
  return header;
}

代码示例来源:origin: theonedev/onedev

private Fragment newFragment(String message, boolean warning) {
  Fragment fragment = new Fragment(CONTENT_ID, "noDiffFrag", this);
  fragment.add(new BlobDiffTitle("title", change));
  if (warning)
    fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-warning")));
  else
    fragment.add(new WebMarkupContainer("icon").add(AttributeAppender.append("class", "fa fa-info-circle")));
  fragment.add(new Label("message", message));
  return fragment;
}

代码示例来源:origin: org.geoserver.web/gs-web-core

protected Component headerPanel() {
  Fragment header = new Fragment(HEADER_PANEL, "header", this);
  // the add button
  header.add(new BookmarkablePageLink<WorkspaceNewPage>("addNew", WorkspaceNewPage.class));
  // the removal button
  header.add(removal = new SelectionRemovalLink("removeSelected", table, dialog));
  removal.setOutputMarkupId(true);
  removal.setEnabled(false);
  // check for full admin, we don't allow workspace admins to add new workspaces
  header.setEnabled(isAuthenticatedAsAdmin());
  return header;
}

代码示例来源:origin: theonedev/onedev

private Component newSinceChangesRow(String id, Date sinceDate) {
  WebMarkupContainer row = new WebMarkupContainer(id);
  row.setOutputMarkupId(true);
  
  row.add(new WebMarkupContainer("avatar"));
  WebMarkupContainer contentColumn = new Fragment("content", "sinceChangesRowContentFrag", this);
  contentColumn.add(AttributeAppender.append("colspan", "2"));
  contentColumn.add(new SinceChangesLink("sinceChanges", requestModel, sinceDate));
  row.add(contentColumn);
  
  row.add(AttributeAppender.append("class", "since-changes"));
  
  return row;
}

相关文章