/* *****************************************************************************
* JFire - it's hot - Free ERP System - http://jfire.org *
* Copyright (C) 2004-2006 NightLabs - http://NightLabs.org *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin St, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
* Or get it online : *
* http://opensource.org/licenses/lgpl-license.php *
******************************************************************************/
package org.nightlabs.jfire.trade.ui.account.editor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.IFormPage;
import org.nightlabs.base.ui.entity.editor.EntityEditor;
import org.nightlabs.base.ui.entity.editor.EntityEditorPageControllerModifyEvent;
import org.nightlabs.base.ui.entity.editor.EntityEditorPageWithProgress;
import org.nightlabs.base.ui.entity.editor.IEntityEditorPageController;
import org.nightlabs.base.ui.entity.editor.IEntityEditorPageFactory;
import org.nightlabs.jfire.trade.ui.resource.Messages;
/**
* An editor page for money transfer.
*
* @author Chairat Kongarayawetchakun - chairatk[at]nightlabs[dot]de
*/
public class MoneyTransferPage extends EntityEditorPageWithProgress
{
/**
* The id of this page.
*/
public static final String ID_PAGE = MoneyTransferPage.class.getName();
private MoneyTransferFilterSection moneyTransferFilterSection;
private MoneyTransferListSection moneyTransferListSection;
/**
* The Factory is registered to the extension-point and creates
* new instances of {@link MoneyTransferPage}.
*/
public static class Factory implements IEntityEditorPageFactory {
public IFormPage createPage(FormEditor formEditor) {
return new MoneyTransferPage(formEditor);
}
public IEntityEditorPageController createPageController(EntityEditor editor) {
return new MoneyTransferPageController(editor);
}
}
/**
* <p>
* This constructor is used by the entity editor
* page extension system.
*
* @param editor The editor for which to create this
* form page.
*/
public MoneyTransferPage(FormEditor editor)
{
super(editor, ID_PAGE, Messages.getString("org.nightlabs.jfire.trade.ui.editor.account.ManualMoneyTransferPage.pageTitle")); //$NON-NLS-1$
}
@Override
protected void addSections(Composite parent) {
MoneyTransferPageController controller = (MoneyTransferPageController) getPageController();
moneyTransferFilterSection = new MoneyTransferFilterSection(this, parent, controller);
getManagedForm().addPart(moneyTransferFilterSection);
moneyTransferListSection = new MoneyTransferListSection(this, parent, controller);
getManagedForm().addPart(moneyTransferListSection);
}
@Override
protected void handleControllerObjectModified(
EntityEditorPageControllerModifyEvent modifyEvent) {
switchToContent(); // multiple calls don't hurt
}
@Override
protected String getPageFormTitle() {
return Messages.getString("org.nightlabs.jfire.trade.ui.editor.account.ManualMoneyTransferPage.pageFormTitle"); //$NON-NLS-1$
}
}