Package com.gwesm

Source Code of com.gwesm.GwesmApplication

package com.gwesm;

import java.io.File;

import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import com.gwesm.core.Account;
import com.gwesm.core.GWESM;
import com.gwesm.dao.CastorDAO;
import com.gwesm.dao.DAO;
import com.gwesm.dao.DAOException;
import com.gwesm.presenters.AccountPresenter;
import com.gwesm.ui.AccountView;

public class GwesmApplication {

  /**
   * @param args
   * @throws DAOException
   */
  public static void main(final String[] args) throws DAOException {

    DAO dao = new CastorDAO();
    GWESM gwesm = dao.loadData("testsData" + File.separator
        + "GWESM-Sample.xml");
    Account account = gwesm.getAccounts().get(1);

    Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());

    AccountPresenter presenter = new AccountPresenter(gwesm, account);

    AccountView view = new AccountView(shell, presenter);
    presenter.refresh();

    shell.open();

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }

  }
}
TOP

Related Classes of com.gwesm.GwesmApplication

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.