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