當前位置: 首頁>>代碼示例>>Java>>正文


Java Project.getUserData方法代碼示例

本文整理匯總了Java中com.intellij.openapi.project.Project.getUserData方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.getUserData方法的具體用法?Java Project.getUserData怎麽用?Java Project.getUserData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.project.Project的用法示例。


在下文中一共展示了Project.getUserData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: triggerNextAction

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
private void triggerNextAction() {
    for (Project project : ProjectManager.getInstance().getOpenProjects()) {
        final STATES state = project.getUserData(STATE);
        if (state == null) {
            continue;
        }
        switch (state) {
            case CLEAN_ALL_NEEDED:
                project.putUserData(STATE, STATES.REFRESH_NEEDED);
                triggerCleanAll(project);
                return;
            case REFRESH_NEEDED:
                project.putUserData(STATE, null);
                ProjectRefreshAction.triggerAction(getDataContext(project));
                return;
        }
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:19,代碼來源:HybrisAntBuildListener.java

示例2: actionPerformed

import com.intellij.openapi.project.Project; //導入方法依賴的package包/類
public void actionPerformed( AnActionEvent e ) {
    Editor editor = ( Editor ) e.getDataContext().getData( "editor" );
    SelectionModel selectionModel = editor.getSelectionModel();
    if ( selectionModel != null ) {
        String selectedText = selectionModel.getSelectedText();
        if ( selectedText != null && selectedText.trim().length() > 0 ) {
            Project project = ( Project ) e.getDataContext().getData( DataConstants.PROJECT );
            String panelid = ( String ) project.getUserData( QuickNotes.KEY_PANELID );
            QuickNotesPanel quickNotesPanel = QuickNotesManager.getInstance().getQuickNotesPanel( panelid );
            if ( quickNotesPanel != null ) {
                FileDocumentManager manager = FileDocumentManager.getInstance();
                VirtualFile virtualFile = manager.getFile( editor.getDocument() );
                quickNotesPanel.addNewNote( "[File: " + virtualFile.getPath() + "]\n" + selectedText );
            }
        }
    }
}
 
開發者ID:jrana,項目名稱:quicknotes,代碼行數:18,代碼來源:AddToQuickNotes.java


注:本文中的com.intellij.openapi.project.Project.getUserData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。