본문 바로가기
반응형

IT40

Check System Version at Runtime Android provides a unique code for each platform version in the Build constants class. Use these codes within your app to build conditions that ensure the code that depends on higher API levels is executed only when those APIs are available on the system.private void setUpActionBar() { // Make sure we're running on Honeycomb or higher to use ActionBar APIs if (Build.VERSION.SDK_INT >= Build.VERS.. 2016. 12. 6.
윈도우에서 경로를 toURI()로 호출할 경우 exception 발생 Windows의 경우 경로에 공백문자가 들어갈 수 있다. 이 공백 문자때문에 toURI()를 호출하면 exception이 발생한다.URL객체일 경우 toURI()를 호출하지 말고 getPath()를 호출해서 File객체로 만든 다음에 File객체의 경로를 가져오도록 한다. 2015. 10. 7.
Eclipse Preference에 값 저장하기 IPreferenceStore preferences = PlatformUI.getPreferenceStore();preferences.setValue(KEY, VALUE); KEY : StringVALUE : Object워크스페이스에 설정한 KEY 값으로 VALUE를 저장한다. 2015. 9. 17.
TreeViewer 컬럼 사이즈를 데이터에 맞춰서 resize하기 investorTree.addListener(SWT.Collapse, new Listener(){ @Override public void handleEvent(Event e) { expandAndResize(false, (TreeItem) e.item); } }); investorTree.addListener(SWT.Expand, new Listener() { @Override public void handleEvent(Event event) { expandAndResize(false, (TreeItem) event.item); } }); private static void expandAndResize(Boolean expand_, TreeItem item_) { System.out.println( (e.. 2015. 9. 17.
반응형