package cn.com.origin.autocodemanager.common.operations;

import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;

public class ViewControlOperation {

	public static void showView(String id) {
		if (id == null || id.trim().equals("")) {
			return;
		}
		try {
			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(id);
		} catch (PartInitException e) {
			e.printStackTrace();
		}
	}

	public static void hideView(ViewPart view) {
		PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(view);
	}

}
