4747import com .duy .ccppcompiler .compiler .CompileManager ;
4848import com .duy .ccppcompiler .compiler .CompilerFactory ;
4949import com .duy .ccppcompiler .diagnostic .DiagnosticPresenter ;
50+ import com .duy .ccppcompiler .diagnostic .DiagnosticView ;
5051import com .duy .ide .compiler .CompileTask ;
5152import com .duy .ide .compiler .INativeCompiler ;
5253import com .duy .ide .filemanager .FileManager ;
@@ -106,14 +107,14 @@ public class EditorActivity extends FullScreenActivity
106107 public TextView mVersionTextView ;
107108 public SymbolBarLayout mSymbolBarLayout ;
108109
109- private TabManager tabManager ;
110+ private TabManager mTabManager ;
110111
111112 private Preferences preferences ;
112113 private ClusterCommand clusterCommand ;
113114 private MenuManager mMenuManager ;
114115 private long mExitTime ;
115116 private SlidingUpPanelLayout mSlidingUpPanelLayout ;
116- private DiagnosticPresenter diagnosticPresenter ;
117+ private DiagnosticPresenter mDiagnosticPresenter ;
117118
118119 @ Override
119120 protected void onRestoreInstanceState (Bundle savedInstanceState ) {
@@ -242,6 +243,10 @@ public void onPanelSlide(View panel, float slideOffset) {
242243 toggleView .animate ().rotation (180 * slideOffset ).start ();
243244 }
244245 });
246+
247+ RecyclerView recyclerView = findViewById (R .id .diagnostic_list_view );
248+ DiagnosticView diagnosticView = new DiagnosticView (recyclerView , this );
249+ mDiagnosticPresenter = new DiagnosticPresenter (diagnosticView , this , mTabManager );
245250 }
246251
247252 private void initToolbar () {
@@ -263,7 +268,7 @@ private void initToolbar() {
263268 menuItem .setOnMenuItemClickListener (this );
264269 menuItem .setShowAsAction (MenuItem .SHOW_AS_ACTION_ALWAYS );
265270
266- tabManager = new TabManager (this );
271+ mTabManager = new TabManager (this );
267272 }
268273
269274 @ Override
@@ -483,7 +488,7 @@ public void onSaved() {
483488 CompilerFactory .CompileType compileType = CompilerFactory .CompileType .GCC ;
484489 INativeCompiler compiler = CompilerFactory .createCompiler (EditorActivity .this , compileType );
485490 CompileManager compileManager = new CompileManager (EditorActivity .this );
486- compileManager .setDiagnosticPresenter (diagnosticPresenter );
491+ compileManager .setDiagnosticPresenter (mDiagnosticPresenter );
487492
488493 CompileTask compileTask = new CompileTask (compiler , srcFiles , compileManager );
489494 compileTask .execute ();
@@ -520,7 +525,7 @@ private void showSoftInput() {
520525 }
521526
522527 public void doClusterCommand (Command command ) {
523- clusterCommand = tabManager .getEditorPagerAdapter ().makeClusterCommand ();
528+ clusterCommand = mTabManager .getEditorPagerAdapter ().makeClusterCommand ();
524529 clusterCommand .setCommand (command );
525530 clusterCommand .doNextCommand ();
526531 }
@@ -545,9 +550,9 @@ public void doCommand(Command command) {
545550 }
546551
547552 private EditorDelegate getCurrentEditorDelegate () {
548- if (tabManager == null || tabManager .getEditorPagerAdapter () == null )
553+ if (mTabManager == null || mTabManager .getEditorPagerAdapter () == null )
549554 return null ;
550- return tabManager .getEditorPagerAdapter ().getCurrentEditorDelegate ();
555+ return mTabManager .getEditorPagerAdapter ().getCurrentEditorDelegate ();
551556 }
552557
553558 public void startPickPathActivity (String path , String encoding ) {
@@ -570,7 +575,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
570575 String file = FileExplorerActivity .getFile (data );
571576 String encoding = FileExplorerActivity .getFileEncoding (data );
572577
573- IEditorPagerAdapter adapter = tabManager .getEditorPagerAdapter ();
578+ IEditorPagerAdapter adapter = mTabManager .getEditorPagerAdapter ();
574579 EditorDelegate delegate = adapter .getCurrentEditorDelegate ();
575580 if (delegate != null ) {
576581 adapter .updateDescriptor (file , encoding );
@@ -588,7 +593,7 @@ private void openText(CharSequence content) {
588593 FileManager fileManager = new FileManager (this );
589594 File newFile = fileManager .createNewFile ("_" + System .currentTimeMillis () + ".txt" );
590595 if (IOUtils .writeFile (newFile , content .toString ())) {
591- tabManager .newTab (newFile );
596+ mTabManager .newTab (newFile );
592597 }
593598 }
594599
@@ -611,7 +616,7 @@ public void openFile(String filePath, String encoding, int offset) {
611616 return ;
612617 }
613618
614- if (!tabManager .newTab (file , offset , encoding )) {
619+ if (!mTabManager .newTab (file , offset , encoding )) {
615620 return ;
616621 }
617622 DBHelper .getInstance (this ).addRecentFile (filePath , encoding );
@@ -626,7 +631,7 @@ public void insertText(CharSequence text) {
626631 }
627632
628633 public TabManager getTabManager () {
629- return tabManager ;
634+ return mTabManager ;
630635 }
631636
632637 @ Override
@@ -647,7 +652,7 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
647652 mExitTime = System .currentTimeMillis ();
648653 return true ;
649654 } else {
650- return tabManager == null || tabManager .closeAllTabAndExitApp ();
655+ return mTabManager == null || mTabManager .closeAllTabAndExitApp ();
651656 }
652657 }
653658 return super .onKeyDown (keyCode , event );
0 commit comments