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


Java Action.setChecked方法代码示例

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


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

示例1: createAction

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
/**
 * Creates a menu action for a team project when TFS 2012 teams are not
 * available.
 */
private Action createAction(final ProjectInfo project) {
    Check.notNull(project, "project"); //$NON-NLS-1$

    final String projectGUID = project.getGUID();

    final Action action = new Action(project.getName()) {
        @Override
        public void run() {
            if (!context.getCurrentProjectInfo().getGUID().equals(projectGUID)) {
                context.setCurrentProject(projectGUID);
                context.setCurrentTeam(null);
                final boolean tfvc = context.getCurrentProjectInfo().getSourceControlCapabilityFlags().contains(
                    SourceControlCapabilityFlags.TFS);
                TFSCommonUIClientPlugin.getDefault().projectOrTeamChanged();
                TFSCommonUIClientPlugin.getDefault().sourceControlChanged(tfvc);
            }
        }
    };

    if (context.getCurrentProjectInfo().getGUID().equals(projectGUID)) {
        action.setChecked(true);
    }

    return action;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:30,代码来源:TeamExplorerControl.java

示例2: getCustomOptions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private Action[] getCustomOptions() {
  	List customOptions = new ArrayList();
  	if (resourceSelectionTree.showIncludeUnversionedButton()) {
      	includeUnversionedAction = new Action(Policy.bind("CommitDialog.includeUnversioned"), SWT.TOGGLE) {
  			public void run() {
  				includeUnversioned = !includeUnversioned;
  				if (includeUnversionedButton.isVisible()) {
  					includeUnversionedButton.setSelection(includeUnversioned);
  				}
  				toggleIncludeUnversioned();
  			}   		    		
      	};  
  		includeUnversionedAction.setChecked(includeUnversioned);
  		customOptions.add(includeUnversionedAction);
  	}
  	keepLocksAction = new Action(Policy.bind("CommitDialog.keepLocks"), SWT.TOGGLE) {
	public void run() {
		keepLocks = !keepLocks;
		if (keepLocksButton.isVisible()) {
			keepLocksButton.setSelection(keepLocks);
		}
	}   		
};
customOptions.add(keepLocksAction);
Action[] customOptionArray = new Action[customOptions.size()];
customOptions.toArray(customOptionArray);
  	return customOptionArray;
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:29,代码来源:SvnWizardCommitPage.java

示例3: makeActions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void makeActions() {
	synchroFilterAction = new Action() {
		public void run() {
			synchroFilterAction
					.setToolTipText("Hide with tool synchronized changes");
			updateFilter(synchroFilterAction);
			refreshTree();
		}
	};
	synchroFilterAction.setChecked(true);
	synchroFilterAction.setText("ChangesFilter");
	synchroFilterAction
			.setToolTipText("Show with tool synchronized changes");
	synchroFilterAction.setImageDescriptor(PlatformUI.getWorkbench()
			.getSharedImages()
			.getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));

	doubleClickAction = new Action() {
		public void run() {
			ISelection selection = viewer.getSelection();
			Object obj = ((IStructuredSelection) selection)
					.getFirstElement();
			if (obj instanceof ResourceChangesFilePatch) {
				ResourceChangesFilePatch filePatch = (ResourceChangesFilePatch) obj;
				selectedfilePatch = filePatch;
				projectController.getProjectList(filePatch);
			}
		}
	};
}
 
开发者ID:1Tristan,项目名称:VariantSync,代码行数:31,代码来源:ResourceChangesView.java

示例4: setActionState

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
/**
 * Set the enable/check state for a command and update the UI
 */
public void setActionState(final String commandId, final boolean isEnabled, final boolean isChecked) {

	final Action action = _allTourChartActions.get(commandId);

	if (action != null) {
		action.setEnabled(isEnabled);
		action.setChecked(isChecked);
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:13,代码来源:TourChart.java

示例5: createActions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
    selectAllAction = new Action() {
        @Override
        public void run() {
            changesTable.selectAll();
            changesTable.setFocus();
        }
    };

    copyAction = new Action() {
        @Override
        public void run() {
            changesTable.copySelectionToClipboard();
        }
    };

    showHideCommentAction = new Action() {
        @Override
        public void run() {
            if (sashForm.getMaximizedControl() == null) {
                sashForm.setMaximizedControl(changesTable);
                setChecked(false);
            } else {
                sashForm.setMaximizedControl(null);
                setChecked(true);
            }
        }
    };
    showHideCommentAction.setToolTipText(Messages.getString("SourceFilesCheckinControl.ShowHideActionTooltip")); //$NON-NLS-1$
    showHideCommentAction.setImageDescriptor(
        AbstractUIPlugin.imageDescriptorFromPlugin(
            TFSCommonUIClientPlugin.PLUGIN_ID,
            "images/vc/sourcefiles_showhidecomment.gif")); //$NON-NLS-1$
    showHideCommentAction.setChecked(true);

    /*
     * must use the deprecated constructor of PropertyDialogAction for 3.0
     * compatibility
     */
    propertiesAction = new PropertyDialogAction(getShell(), changesTable);
    propertiesAction.setEnabled(false);

    registerGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAllAction);
    registerGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
    registerGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:47,代码来源:SourceFilesCheckinControl.java

示例6: createMenus

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createMenus() {
	openAction = new OpenFileInSystemEditorAction(getSite().getPage(), treeViewer);
	
	MenuManager menuMgr = new MenuManager("#MergeResultsViewPopupMenu"); //$NON-NLS-1$
	menuMgr.setRemoveAllWhenShown(true);
	menuMgr.addMenuListener(new IMenuListener() {
		public void menuAboutToShow(IMenuManager manager) {
			MergeResultsView.this.fillContextMenu(manager);
		}
	});
	Menu menu = menuMgr.createContextMenu(treeViewer.getControl());
	treeViewer.getControl().setMenu(menu);		
	getSite().registerContextMenu(menuMgr, treeViewer);

	toggleLayoutActions = new ToggleLayoutAction[] {
	        new ToggleLayoutAction(this, Messages.MergeResultsView_flat, 
	            Activator.IMAGE_LAYOUT_FLAT, 
	            MODE_FLAT),
		    new ToggleLayoutAction(this, Messages.MergeResultsView_compressed, 
			    Activator.IMAGE_LAYOUT_COMPRESSED, 
			    MODE_COMPRESSED_FOLDERS)
	      };
	IActionBars actionBars = getViewSite().getActionBars();
	IMenuManager actionBarsMenu = actionBars.getMenuManager();
	removeAction.setEnabled(false);
	actionBarsMenu.add(removeAction);
	actionBarsMenu.add(removeAllAction);
	actionBarsMenu.add(new Separator());		
    actionBarsMenu.add(toggleLayoutActions[0]);
    actionBarsMenu.add(toggleLayoutActions[1]);	
    actionBarsMenu.add(new Separator());
    
    toggleConflictsOnlyAction = new Action("Show conflicts only") { //$NON-NLS-1$
        public void run() {
	        store.setValue(MergeResultsView.CONFLICTS_ONLY_PREFERENCE, toggleConflictsOnlyAction.isChecked());
	      	if (toggleConflictsOnlyAction.isChecked()) setContentDescription(Messages.MergeResultsView_conflictsMode);
	      	else setContentDescription(""); //$NON-NLS-1$
	        refresh();
        }
      };
      toggleConflictsOnlyAction.setChecked(store.getBoolean(MergeResultsView.CONFLICTS_ONLY_PREFERENCE));    
      toggleConflictsOnlyAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(Activator.IMAGE_CONFLICT));
      actionBarsMenu.add(toggleConflictsOnlyAction);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:45,代码来源:MergeResultsView.java

示例7: createActions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {
    IActionBars bars = getViewSite().getActionBars();
    IMenuManager mgr = bars.getMenuManager();

    Filter allColumnsFilter = new Filter("Full");
    allColumnsFilter.filterFields.add(Pattern.compile(".*"));
    Action allColumnsAction = new Action("Show all columns", IAction.AS_RADIO_BUTTON) {
        @Override
        public void run() {
            if (isChecked()) {
                applyFilter(allColumnsFilter);
            }
        }
    };
    allColumnsAction.setChecked(true);
    mgr.add(allColumnsAction);

    Filter keyColumnsFilter = new Filter("Brief");
    keyColumnsFilter.filterFields.add(Pattern.compile("^Command$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^PTV$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^Seq.ID$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^FRC$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^DASS$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^MCS$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^[A-Z]$"));
    keyColumnsFilter.filterFields.add(Pattern.compile("^Comment$"));
    mgr.add(new Action("Show key columns", IAction.AS_RADIO_BUTTON) {
        @Override
        public void run() {
            if (isChecked()) {
                applyFilter(keyColumnsFilter);
            }
        }
    });

    mgr.add(new Separator());

    Action showRelativeTimeAction = new Action("Show relative time", IAction.AS_CHECK_BOX) {
        @Override
        public void run() {
            showRelativeTime = isChecked();
            tableViewer.refresh();
        }
    };
    showRelativeTimeAction.setChecked(showRelativeTime);
    mgr.add(showRelativeTimeAction);
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:48,代码来源:CommandHistoryView.java

示例8: createQuickMenus

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createQuickMenus(){
	IToolBarManager man = getViewSite().getActionBars().getToolBarManager();
	man.add(new Action("Expand All", ImageUtil.getImageDescriptor(Images.expand)) {
		public void run() {
			objTreeViewer.expandAll();
		}
	});
	man.add(new Action("Collapse All", ImageUtil.getImageDescriptor(Images.collapse)) {
		public void run() {
			objTreeViewer.collapseAll();
		}
	});
	man.add(new Separator());
	man.add(new OpenServerManagerAction());
	man.add(new Action("Filter Object", ImageUtil.getImageDescriptor(Images.filter)) {
		public void run() {
			new ObjectSelectionDialog().show();
		}
	});
	man.add(new Action("Reload", ImageUtil.getImageDescriptor(Images.refresh)) {
		public void run() {
			forceRefresh();
		}
	});
	
	IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
	menuManager.add(new Action("Remove Inactive", ImageUtil.getImageDescriptor(Images.minus)) {
		public void run() {
			boolean result = MessageDialog.openConfirm(getViewSite().getShell(), "Remove Inactive",  "Inactive object(s) will be removed. Continue?");
			if (result) {
				AgentModelThread.removeInactive();
			}
		}
	});
	menuManager.add(new Separator());
	MenuManager presentMenu = new MenuManager("Object Presentation");
	menuManager.add(presentMenu);
	Action hieracyMenu = new Action("Hierarchical", IAction.AS_RADIO_BUTTON) {
		public void run() {
			mode = PresentMode.HIERACHY_MODE;
			refresh();
		}
	};
	hieracyMenu.setImageDescriptor(ImageUtil.getImageDescriptor(Images.tree_mode));
	presentMenu.add(hieracyMenu);
	Action flatMenu = new Action("Flat", IAction.AS_RADIO_BUTTON) {
		public void run() {
			mode = PresentMode.FLAT_MODE;
			refresh();
		}
	};
	flatMenu.setImageDescriptor(ImageUtil.getImageDescriptor(Images.flat_layout));
	presentMenu.add(flatMenu);
	hieracyMenu.setChecked(true);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:56,代码来源:ObjectNavigationView.java

示例9: makeActions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
protected void makeActions()
{
  newView = new Action()
  {
    @Override
    public void run()
    {
      createNewView();
    }
  };
  newView.setText("New instance of " + _myTitle);
  newView.setToolTipText("Create a fresh instance of this view");
  newView.setImageDescriptor(Activator
      .getImageDescriptor("icons/newView.png"));

  copyToClipboard = new Action()
  {
    @Override
    public void run()
    {
      copyToClipboard();
    }
  };
  copyToClipboard.setText("Copy to clipboard");
  copyToClipboard.setToolTipText("Copy analysis to clipboard");
  copyToClipboard.setImageDescriptor(PlatformUI.getWorkbench()
      .getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY));

  followSelection = new Action("Follow selection", SWT.TOGGLE)
  {
    @Override
    public void run()
    {
      // don't worry, we can ignore the events
    }
  };
  followSelection.setChecked(true);
  followSelection.setToolTipText("Link with selection");
  followSelection.setImageDescriptor(PlatformUI.getWorkbench()
      .getSharedImages().getImageDescriptor(ISharedImages.IMG_ELCL_SYNCED));

}
 
开发者ID:debrief,项目名称:limpet,代码行数:43,代码来源:CoreAnalysisView.java

示例10: fillLocalPullDown

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void fillLocalPullDown(IMenuManager menuManager) {
  ImageDescriptor updateListImage = PlatformUI.getWorkbench().getSharedImages()
      .getImageDescriptor(ISharedImages.IMG_TOOL_COPY);

  IAction theAction = new DisabledWhileRunningJobAction("Update List (active)", updateListImage,
      updateActiveListJob);
  menuManager.add(theAction);

  theAction = new DisabledWhileRunningJobAction("Update List (page)", updateListImage,
      updateListJob);
  menuManager.add(theAction);

  theAction = new DisabledWhileRunningJobAction("Update List (full)", updateListImage,
      updateFullListJob);
  menuManager.add(theAction);

  String preferedLanguage = EclipseForcesPlugin.getDefault().getPreferenceStore()
      .getString(EclipseForcesPlugin.PREFERENCE_LANGUAGE);
  final String LANG_GROUP = "lang_group"; //$NON-NLS-1$

  MenuManager langMenuManager = new MenuManager("Use &language", null);
  menuManager.add(new Separator());
  menuManager.add(langMenuManager);

  langMenuManager.add(new GroupMarker(LANG_GROUP));
  for (String lang : LanguageSupportFactory.supportedLanguages()) {
    Action langAction = new Action(lang, IAction.AS_RADIO_BUTTON) {
      @Override
      public void run() {
        if (isChecked()) {
          EclipseForcesPlugin.getDefault().getPreferenceStore()
          .setValue(EclipseForcesPlugin.PREFERENCE_LANGUAGE, getText());
        }
      }
    };
    langMenuManager.appendToGroup(LANG_GROUP, langAction);
    if (lang.equals(preferedLanguage)) {
      langAction.setChecked(true);
    }
  }

}
 
开发者ID:fmoraes74,项目名称:eclipseforces,代码行数:43,代码来源:ContestListView.java

示例11: createActions

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void createActions() {

		_actionCalendarOptions = new ActionCalendarOptions(this);
		_actionTourInfo = new ActionTourInfo(this, _parent);

		/*
		 * Back
		 */
		{
			_actionBack = new Action() {
				@Override
				public void run() {
					_calendarGraph.scroll_WithWheel_Screen(1);
				}
			};
			_actionBack.setText(Messages.Calendar_View_Action_Back);
			_actionBack.setToolTipText(Messages.Calendar_View_Action_Back_Tooltip);
			_actionBack.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ArrowUp));
		}

		/*
		 * Forward
		 */
		{
			_actionForward = new Action() {
				@Override
				public void run() {
					_calendarGraph.scroll_WithWheel_Screen(-1);
				}
			};
			_actionForward.setText(Messages.Calendar_View_Action_Forward);
			_actionForward.setToolTipText(Messages.Calendar_View_Action_Forward_Tooltip);
			_actionForward.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ArrowDown));
		}

		/*
		 * Link with other views
		 */
		{
			_actionSetLinked = new Action(null, Action.AS_CHECK_BOX) {
				@Override
				public void run() {
					_calendarGraph.setLinked(_actionSetLinked.isChecked());
				}
			};
			_actionSetLinked.setText(Messages.Calendar_View_Action_LinkWithOtherViews);
			_actionSetLinked.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__SyncViews));
			_actionSetLinked.setChecked(true);
		}

		/*
		 * Today
		 */
		{
			_actionGotoToday = new Action() {
				@Override
				public void run() {
					_calendarGraph.gotoDate_Today();
				}
			};
			_actionGotoToday.setText(Messages.Calendar_View_Action_GotoToday);
			_actionGotoToday.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ZoomCentered));
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:65,代码来源:CalendarView.java

示例12: updatePhotoAction

import org.eclipse.jface.action.Action; //导入方法依赖的package包/类
private void updatePhotoAction() {

		String toolTip;
		ImageDescriptor imageDescriptor;

		final boolean isShowPhotos = _tcc.isShowTourPhotos;
		final boolean isShowTooltip = _tcc.isShowTourPhotoTooltip;

		if (isShowPhotos && isShowTooltip) {

			toolTip = Messages.Tour_Action_TourPhotosWithTooltip_Tooltip;
			imageDescriptor = _imagePhotoTooltip;

		} else if (!isShowPhotos && !isShowTooltip) {

			toolTip = Messages.Tour_Action_TourPhotos;
			imageDescriptor = _imagePhoto;

		} else {

			toolTip = Messages.Tour_Action_TourPhotosWithoutTooltip_Tooltip;
			imageDescriptor = _imagePhoto;
		}

		final Action action = _allTourChartActions.get(ACTION_ID_IS_SHOW_TOUR_PHOTOS);

		action.setToolTipText(toolTip);
		action.setImageDescriptor(imageDescriptor);
		action.setChecked(isShowPhotos);
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:31,代码来源:TourChart.java


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