Package com.gwesm.ui

Source Code of com.gwesm.ui.AccountView

package com.gwesm.ui;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;

import com.gwesm.presenters.AccountPresenter;
import com.gwesm.presenters.CharacterPresenter;

public class AccountView extends SWTView {

  AccountPresenter presenter;

  transient CTabFolder container;

  public AccountView(final Composite parent, final AccountPresenter presenter) {
    super(parent, presenter);
    this.presenter = presenter;
    this.setLayout(new FillLayout());

    this.container = new CTabFolder(this, SWT.NONE);
    this.container.setSimple(false);
  }

  @Override
  public void refresh() {
    for (CharacterPresenter characterPresenter : this.presenter
        .getCharacterPresenters()) {
      CTabItem characterTabItem = new CTabItem(this.container, SWT.NONE);
      characterTabItem.setText(characterPresenter.getCharacterName());
      characterTabItem.setControl(new CharacterView(this.container,
          characterPresenter));

    }

  }
}
TOP

Related Classes of com.gwesm.ui.AccountView

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.