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