當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。