2016-12-07 13 views
0

私は学校のプロジェクトを作っていますが、ロードされません。 についてここでなぜ私のビューの読み込みがありません

Connector Trackersは、いくつかのスクリーンショットは、上部のバーが点滅している

![] 
(http://pierlot.com.au:8888/repository/images/Screenshot.png) 
![] 
(http://pierlot.com.au:8888/repository/images/Screenshot2.png) 

ノートです他にも一切NOエラーログは、私がログに印刷されているものよりも、絶対にしているが、私はいくつかのものを入手できますか

そしてここでは私のコードです

class information extends CustomComponent{ 
    /** 
    * 
    */ 
    private static final long serialVersionUID = 1L; 

    public information(String... filenames){ 
    VerticalLayout information = new VerticalLayout(); 
    Label text = new Label(); 
    text.setContentMode(ContentMode.HTML); 
    HashMap<Integer,Integer> pageno = new HashMap<Integer,Integer>(); 
    pageno.put(0,0); 
    Button nextb = new Button(FontAwesome.ARROW_CIRCLE_O_RIGHT); 
    Button previousb = new Button(FontAwesome.ARROW_CIRCLE_O_LEFT); 
    nextb.addClickListener(event -> { 
    if(pageno.get(0)==filenames.length){ 

    }else{ 
     pageno.put(0,pageno.get(0)+1); 
    } 
    }); 
    previousb.addClickListener(event -> { 
    // TODO Auto-generated method stub 
     if(pageno.get(0)==0){ 

    }else{ 
     pageno.put(0,pageno.get(0)-1); 
    } 
    }); 
    String f = File.separator; 
    String baseadress=new String("C:"+File.separator+"Users"+File.separator+"Countrywide Austral"+File.separator+"OneDrive"+File.separator+f+"ERPs"+f+"Term 4"+f); 
    setCompositionRoot(information); 
    information.addComponent(text); 
    information.addComponent(new HorizontalLayout(nextb,previousb)); 
    while(true){ 
     try { 
     TextFileProperty stri=new TextFileProperty(new File(baseadress+filenames[pageno.get(0)]+".txt")); 
     text.setPropertyDataSource(stri); 

     } catch (ReadOnlyException | ConversionException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
     } 

    } 
    } 
} 
public class SetiView extends CustomComponent implements View { 


    private static final long serialVersionUID = 1L; 
    /** 
    * Submit Button 
    * 
    */ 
    Button submit = new Button("Submit"); 

    @Override 
    public void enter(ViewChangeEvent event) { 

    getUI().getNavigator().addViewChangeListener(new ViewChangeListener() { 

     /** 
     * 
     */ 
     private static final long serialVersionUID = 120255140723534027L; 

     @Override 
     public boolean beforeViewChange(ViewChangeEvent event) { 
     // TODO Auto-generated method stub 
     return false; 
     } 

     @Override 
     public void afterViewChange(ViewChangeEvent event) { 
     // TODO Auto-generated method stub 

     } 
    }); 
    getUI().getConnectorTracker().unregisterConnector(this); 
    getUI(); 
    UI.getCurrent().getPage(); 

    Label scorel = new Label(); 
    //submit.addClickShort 
    //int score=0; 
    // TODO Auto-generated method stub 
    HashMap<Integer,Component> questions = new HashMap<Integer,Component>(); 
    HashMap<Integer,Object> interfacetransfer = new HashMap<Integer, Object>(); 
    interfacetransfer.put(0, 0); 

    //Layouts/Tabs 
    // 

    /** 
    * Information Layout 
    * 
    * 
    */ 









    /** 
    * Bibliography Layout 
    * 
    * 
    */ 
    VerticalLayout bibliographyl= new VerticalLayout(); 
    FreeformQuery fq = new FreeformQuery("SELECT * FROM vwBibliographies", ((JDBCConnectionPool)getSession().getAttribute("pool"))); 
     Table bibliography = new Table(); 
     try { 
     SQLContainer container = new SQLContainer(fq); 
     bibliography.setContainerDataSource(container); 
    } catch (SQLException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 
     //Scanner scan= new Scanner(System.in); 
     //scan.findInLine(""); 

     // Notification.show(new Scanner(System.in).nextLine()); 
     bibliographyl.addComponent(bibliography); 



    /** 
    * Quiz Layout 
    * 
    * 
    */ 
    VerticalLayout popupquiz = new VerticalLayout(); 
    Window quizwindows = new Window(); 
    quizwindows.setContent(popupquiz); 
    popupquiz.addComponent(scorel); 




    /** 
    * Glossary Layout 
    * 
    * 
    */ 
    VerticalLayout glossary = new VerticalLayout(); 
    String query="Select * FROM vwGlossary"; 
    getSession(); 
    FreeformQuery glossaryquery=new FreeformQuery(query, ((JDBCConnectionPool)VaadinSession.getCurrent().getAttribute("pool"))); 
    Table glossarytable = new Table(); 
    glossarytable.setSizeFull(); 
    glossary.addComponent(glossarytable); 
try { 
    glossarytable.setContainerDataSource(new SQLContainer(glossaryquery)); 
} catch (SQLException e1) { 
    // TODO Auto-generated catch block 
    e1.printStackTrace(); 
} 





    //questions.put(1, new QuizQuestion("")) 

    questions.put(0,new VerticalLayout(new Label("What state in America is SETI based in?"))); 

    ((AbstractComponentContainer) questions.get(0)).addComponent(new OptionGroup("")); 
    ((OptionGroup)((AbstractOrderedLayout) questions.get(0)).getComponent(1)).addItems("Colorado","California","Massachusets"); 
    submit.addClickListener(event1 -> { 
    // TODO Auto-generated method stub 
    if(submit.getCaption().equals("Submit")&&popupquiz.getComponent(0).equals(questions.get(0))){ 
     if(((OptionGroup)((VerticalLayout)questions.get(0)).getComponent(0)).getValue().equals("California")){ 
     Notification.show("Correct",Type.ASSISTIVE_NOTIFICATION); 
     submit.setCaption("Next"); 
    interfacetransfer.put(0, 1); 

     }else{ 
     Notification.show("Incorrect",Type.ERROR_MESSAGE); 
     submit.setCaption("Next"); 
     }} 

    }); 
    questions.put(1,new VerticalLayout()); 
    ((AbstractComponentContainer) questions.get(1)).addComponent(new Label("Am I smart?")); 
    ((AbstractComponentContainer) questions.get(1)).addComponent(new CheckBox()); 
    submit.addClickListener(event1 -> { 
    // TODO Auto-generated method stub 
    if(submit.getCaption().equals("Submit")&&popupquiz.getComponent(0).equals(questions.get(1))){ 
    if(((CheckBox)((AbstractOrderedLayout) questions.get(1)).getComponent(1)).getValue().equals(true)){ 
     Notification.show("Correct"); 
     submit.setCaption("Next"); 
     interfacetransfer.put(0,((Integer)interfacetransfer.get(0))+1); 
    }else{ 
     Notification.show("Incorrect"); 
     submit.setCaption("Next"); 
    } 
    }}); 

    for(int i=0;questions.size()-1>i;i++){ 
     int e=i; 
     submit.addClickListener(event1 -> { 
     // TODO Auto-generated method stub 

     if(submit.getCaption().equals("Next")&&popupquiz.getComponent(e).equals(questions.get(e))){ 
      popupquiz.removeAllComponents(); 
      if(e!=questions.size()-1){ 
      popupquiz.addComponent(questions.get(e+1)); 
      submit.setCaption("Submit"); 
      popupquiz.addComponent(submit); 
      scorel.setCaption(Integer.toString((int) interfacetransfer.get(0))); 
      popupquiz.addComponent(scorel); 
      } 
     } 
     }); 
    } 

    VerticalLayout mainlayout = new VerticalLayout(MainView.nav); 

TabSheet tab = new TabSheet(); 
mainlayout.addComponent(tab); 
AbstractLayout quizl = new VerticalLayout(); 
tab.addTab(new information("Page 1","Page 2"),"Information"); 
tab.addTab(quizl,"Quiz"); 
setCompositionRoot(mainlayout); 

tab.addTab(bibliographyl,"Bibliography"); 
tab.addTab(glossary,"Glossary"); 

Window quiz = new Window("Quiz"); 
quiz.center(); 
tab.addSelectedTabChangeListener(event1 -> { 
// TODO Auto-generated method stub 
if(event1.getTabSheet().equals(tab.getTab(quizl))){ 
    quiz.isVisible(); 
}else{ 
    quiz.setVisible(false); 
} 

}); 
quiz.setContent(popupquiz); 
popupquiz.addComponent(questions.get(0)); 
popupquiz.addComponent(submit); 
getUI().addWindow(quiz); 


getSession(); 
//getting current date and time using Date class 
mainlayout.addComponent(new Label((String) VaadinSession.getCurrent().getAttribute("sessionupdate"))); 
    } 

} 
+0

スクリーンショットはどこにありますか?また、 "それは読み込まれません"とはどういう意味ですか?何がロードされるはずですか? –

+0

ローディングバーのように、ちょうど移動します –

+0

(リンクをコピーして(画像を置き換える)) –

答えて

0

ConnectorTrackerは、UIをアクティブに保つために使用されます。彼は自分のコードを消去する必要があるかもしれません(EclipseメニューのProject-> Clean)、そしてコンパイルされたコードが正しくない場合に再構築する必要があるかもしれません。すべてのクラス名がキャメルケース(ConnectorTrackerなど)である必要があることを彼に喚起することもできます。

1

コードに無限ループがあります。 break;を追加するか、whileループが永久にループしないようにwhile条件を更新してください。

while(true){ 
    try { 
    TextFileProperty stri=new TextFileProperty(new File(baseadress+filenames[pageno.get(0)]+".txt")); 
    text.setPropertyDataSource(stri); 

    } catch (ReadOnlyException | ConversionException e) { 
    // TODO Auto-generated catch block 
    e.printStackTrace(); 
    } 

} 
} 
関連する問題