当前位置: 首页>>代码示例>>Java>>正文


Java IAction.setEnabled方法代码示例

本文整理汇总了Java中org.eclipse.jface.action.IAction.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java IAction.setEnabled方法的具体用法?Java IAction.setEnabled怎么用?Java IAction.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.action.IAction的用法示例。


在下文中一共展示了IAction.setEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof DesignDocumentFunctionTreeObject) {
		DesignDocumentFunctionTreeObject ddfto = (DesignDocumentFunctionTreeObject)treeObject;
		// filter function
		if (treeObject instanceof DesignDocumentFilterTreeObject) {
			action.setEnabled(true);
		}
		// update function
		else if (treeObject instanceof DesignDocumentUpdateTreeObject) {
			action.setEnabled(true);
		}
		// view function
		else {
			action.setEnabled(ddfto.getName().equals(CouchKey.reduce.key()));
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:DeleteDesignDocumentFunctionAction.java

示例2: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject)
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_LISTENERS;
		else if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:CreateListenerAction.java

示例3: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			ObjectsFolderTreeObject ofto = (ObjectsFolderTreeObject)treeObject;
			enable = ofto.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_ACTIONS;
			treeObject = ofto.getParent();
		}
		if (enable && treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:CreateMobileRouteActionComponentAction.java

示例4: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_SHEETS;
		}
		else if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:CreateSheetAction.java

示例5: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject)
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_DOCUMENTS;
		else if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:CreateDocumentAction.java

示例6: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			ObjectsFolderTreeObject ofto = (ObjectsFolderTreeObject)treeObject;
			enable = ofto.folderType == ObjectsFolderTreeObject.FOLDER_TYPE_EVENTS;
			treeObject = ofto.getParent();
		}
		if (enable && treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:CreateMobileRouteEventComponentAction.java

示例7: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = false;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			if (dbo instanceof UIDynamicAction) {
				IonBean ionBean = ((UIDynamicAction)dbo).getIonBean();
				if (ionBean != null && ionBean.getName().equals("CallSequenceAction")) {
					enable = true;
				}
			}
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:MobileComponentImportVariablesAction.java

示例8: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = true;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof ObjectsFolderTreeObject) {
			enable = ((ObjectsFolderTreeObject)treeObject).folderType == ObjectsFolderTreeObject.FOLDER_TYPE_TESTCASES;
		}
		else {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:CreateTestCaseAction.java

示例9: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = false;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:16,代码来源:ChangeToAttributeStepAction.java

示例10: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setEnabled(actionModel.isEnabled);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:13,代码来源:CreateStubFromXMLAction.java

示例11: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = false;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof TransactionTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
			enable = actionModel.isEnabled;
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:16,代码来源:TransactionEditHandlersAction.java

示例12: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setEnabled(actionModel.isEnabled);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:CreateFormFromTransactionAction.java

示例13: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
@Override
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject != null) {
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setEnabled(actionModel.isEnabled);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:12,代码来源:ChangeToBodyParameterAction.java

示例14: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	super.selectionChanged(action, selection);
	IStructuredSelection structuredSelection = (IStructuredSelection) selection;
	TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
	if (treeObject instanceof MobilePageComponentTreeObject) {
		DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
		ActionModel actionModel = DatabaseObjectsAction.selectionChanged(getClass().getName(), dbo);
		action.setEnabled(actionModel.isEnabled);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:11,代码来源:DisableMobilePageComponentAction.java

示例15: selectionChanged

import org.eclipse.jface.action.IAction; //导入方法依赖的package包/类
public void selectionChanged(IAction action, ISelection selection) {
	try {
		boolean enable = false;
		super.selectionChanged(action, selection);
		IStructuredSelection structuredSelection = (IStructuredSelection) selection;
		TreeObject treeObject = (TreeObject) structuredSelection.getFirstElement();
		if (treeObject instanceof DatabaseObjectTreeObject) {
			DatabaseObject dbo = (DatabaseObject) treeObject.getObject();
			enable = dbo.getProject().getMobileBuilder().isIonicTemplateBased();
		}
		action.setEnabled(enable);
	}
	catch (Exception e) {}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:15,代码来源:CreateMobileApplicationComponentAction.java


注:本文中的org.eclipse.jface.action.IAction.setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。