TavernerPOS - Source Code

Clone: 

git clone http://www.librarysmith.co.uk/tavernerPOS

 

package com.floreantpos.bo.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Icon;
import javax.swing.JTabbedPane;

import com.floreantpos.bo.ui.BackOfficeWindow;
import com.floreantpos.bo.ui.explorer.ModifierGroupExplorer;

public class ModifierGroupExplorerAction extends AbstractAction {

	public ModifierGroupExplorerAction() {
		super(com.floreantpos.POSConstants.MENU_MODIFIER_GROUPS);
	}

	public ModifierGroupExplorerAction(String name) {
		super(name);
	}

	public ModifierGroupExplorerAction(String name, Icon icon) {
		super(name, icon);
	}

	public void actionPerformed(ActionEvent e) {
		BackOfficeWindow backOfficeWindow = com.floreantpos.util.POSUtil.getBackOfficeWindow();
		JTabbedPane tabbedPane;
		ModifierGroupExplorer mGroup;
		tabbedPane = backOfficeWindow.getTabbedPane();
		int index = tabbedPane.indexOfTab(com.floreantpos.POSConstants.MODIFIER_GROUP_EXPLORER);
		if (index == -1) {
			mGroup = new ModifierGroupExplorer();
			tabbedPane.addTab(com.floreantpos.POSConstants.MODIFIER_GROUP_EXPLORER, mGroup);
		}
		else {
			mGroup = (ModifierGroupExplorer) tabbedPane.getComponentAt(index);
		}
		tabbedPane.setSelectedComponent(mGroup);
	}

}

Add comment
These comments are moderated so so won't be published until reviewed.