本文整理匯總了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()));
}
}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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) {}
}
示例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);
}
}
示例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);
}
}
示例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) {}
}