Java 类org.eclipse.ui.texteditor.StatusLineContributionItem 实例源码

项目:APICloud-Studio    文件:CommonTextEditorActionContributor.java   
@Override
public void contributeToStatusLine(IStatusLineManager statusLineManager) {
    commandsMenuContributionItem = new CommandsMenuContributionItem();
    statusLineManager.add(commandsMenuContributionItem);
    super.contributeToStatusLine(statusLineManager);

    inputPositionStatsContributionItem = new StatusLineContributionItem(ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION, true, 24);
    IContributionItem[] contributionItems = statusLineManager.getItems();
    for (IContributionItem contributionItem : contributionItems) {
        String id = contributionItem.getId();

        if (ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION.equals(id)) {
            statusLineManager.remove(contributionItem);
            statusLineManager.add(inputPositionStatsContributionItem);
        }
    }
}
项目:tlaplus    文件:TLAMultiPageEditorActionBarContributor.java   
public TLAMultiPageEditorActionBarContributor()
{
    super();
    fContentAssistProposal = new RetargetTextEditorAction(TLAEditorMessages.getResourceBundle(),
            "ContentAssistProposal."); //$NON-NLS-1$
    fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    fContentAssistTip = new RetargetTextEditorAction(TLAEditorMessages.getResourceBundle(), "ContentAssistTip."); //$NON-NLS-1$
    fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);

    // status field for the line and column of the cursor
    cursorPositionStatusField = new StatusLineContributionItem(
            ITextEditorActionConstants.STATUS_CATEGORY_INPUT_POSITION);
}
项目:eclipseRecorder    文件:LogoManager.java   
private synchronized void addLogoToStatusLine(String imageFilePath, String toolTip) {
    Image codingspectatorLogo= Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, imageFilePath).createImage(); //$NON-NLS-1$
    StatusLineContributionItem contributionItem= new StatusLineContributionItem(STATUS_LINE_CONTRIBUTION_ITEM_ID);
    contributionItem.setImage(codingspectatorLogo);
    contributionItem.setToolTipText(toolTip);
    IWorkbench workbench = PlatformUI.getWorkbench();
    getStatusLineManager().add(contributionItem);
    getStatusLineManager().update(false);

    CommandAction commandAction = new CommandAction(workbench, COMMAND_ID);
    contributionItem.setActionHandler(commandAction);   
}