/*
 * Copyright (C) 2005 NTT DATA Corporation
 * 
 */
package org.postgresforest.tool.actionset;

import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.postgresforest.tool.util.SessionProperty;
import org.postgresforest.tool.view.ViewUtil;
import org.postgresforest.tool.view.brokenlog.BrokenLogView;
import org.postgresforest.tool.view.config.ConfigView;
import org.postgresforest.tool.view.dbinstance.DbInstanceView;
import org.postgresforest.tool.view.ddl.DdlView;
import org.postgresforest.tool.view.gsc.GscView;
import org.postgresforest.tool.view.hash.HashView;
import org.postgresforest.tool.view.menu.AdminMenuView;
import org.postgresforest.tool.view.partitionlist.PartitionListView;
import org.postgresforest.tool.view.serverstatus.ServerStatusView;
import org.postgresforest.tool.view.tablecolumn.TableColumnView;
import org.postgresforest.tool.view.user.UserView;

/**
 * 管理者ログアウトアクションクラス
 *
 */
public class AdminLogoutAction implements IWorkbenchWindowActionDelegate {

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
	 */
	public void dispose() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
	 */
	public void init(IWorkbenchWindow window) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
	 */
	public void run(IAction action) {
		//セッション･プロパティをクリア
		SessionProperty.set("gsc", null);
	    SessionProperty.set("selectDb",null);
	    SessionProperty.set("tableInfo",null);


	    //各ビューを再表示する
	
		ViewUtil.updateView(ServerStatusView.ID);
		ViewUtil.updateView(GscView.ID);
		ViewUtil.updateView(UserView.ID);
		ViewUtil.updateView(ConfigView.ID);
		ViewUtil.updateView(HashView.ID);
	    ViewUtil.updateView(AdminMenuView.ID);

		ViewUtil.updateView(DbInstanceView.ID);
		ViewUtil.updateView(DdlView.ID);
		ViewUtil.updateView(TableColumnView.ID);
		ViewUtil.updateView(PartitionListView.ID);
//TODOMASU TableListViewはいらないのでアップデートしない
//		ViewUtil.updateView(TableListView.ID);
		//MASUCOMMENT ADD
		ViewUtil.updateView(BrokenLogView.ID);

	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
	 */
	public void selectionChanged(IAction action, ISelection selection) {
		// TODO Auto-generated method stub

	}

}
