Search in sources :

Example 16 with CubridBrokerFolder

use of com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder in project cubrid-manager by CUBRID.

the class StopBrokerEnvAction method isSupportedNode.

/**
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
	 *      .lang.Object)
	 * @param obj the object
	 * @return <code>true</code> if supported;<code>false</code>
	 */
public static boolean isSupportedNode(Object obj) {
    if (obj instanceof CubridBrokerFolder) {
        CubridBrokerFolder selection = ((CubridBrokerFolder) obj);
        ServerUserInfo userInfo = selection.getServer().getServerInfo().getLoginedUserInfo();
        if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
            return false;
        }
        return selection.isRunning();
    }
    return false;
}
Also used : ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridBrokerFolder(com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)

Aggregations

CubridBrokerFolder (com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)16 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)8 CubridBroker (com.cubrid.cubridmanager.ui.spi.model.CubridBroker)6 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)5 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)4 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)2 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)2 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)2 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 TreeViewer (org.eclipse.jface.viewers.TreeViewer)2 DecoratedImage (com.cubrid.common.ui.decorator.DecoratedImage)1 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)1 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)1 DefaultCubridNode (com.cubrid.common.ui.spi.model.DefaultCubridNode)1 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)1 StartBrokerEnvTask (com.cubrid.cubridmanager.core.broker.task.StartBrokerEnvTask)1 StopBrokerEnvTask (com.cubrid.cubridmanager.core.broker.task.StopBrokerEnvTask)1 ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)1 StartBrokerAction (com.cubrid.cubridmanager.ui.broker.action.StartBrokerAction)1