Download - Eclipse RAP - Single Source
ECLIPSE RAP Single Source - desktop, web, mobile
조현종 (2011/06/17, v.0.6.0)http://cafe.naver.com/eclipsepluginhttp://hangumkj.blogspot.com/[email protected]
목 차
Eclipse RAP 란 ? Eclipse 살펴보기 SWT (Widget 소개 ) SWT (Layout 소개 ) JFace (Viewer 소개 )
RAP Architecture 개발환경 Setup 및 HelloWorld RAP 개발 살펴보기 JUnit Test
RAP 장점 RAP 단점 RAP Incubator Demo 참고자료
Eclipse RCP
Eclipse RAP
Eclipse Rich Ajax Platform (RAP) 2006 년 6 월 시작 (0.1 시작 ~ 현재 1.4 RC3) 확장 포인트 개발
RWT(RAP Widget Toolkit)/JFace 사용 기본 베이스는 OSGi
Eclipse RAP 란 ?
• Eclipse 식으로 Web Application 개발
Eclipse RCP 의 Mail Applica-tion Demo
Eclipse RAP 의 Mail Applica-tion Demo
Eclipse RAP 의 Mail Application Demo + theme
Eclipse RAP 란 ?
Eclipse RAP 란 ?
대부분 브라우저 호환성 지원
Servlet 웹 컨테이너 지원
RAP Default component
Eclipse 살펴보기
Runtime is OSGi (Equinox) Generic Workbench Workspace Help Team Plugin(Bundle)
Eclipse 살펴보기
Eclipse 살펴보기
SWT(Widget 소개 )
SWT(Widget 소개 )
SWT(Widget 소개 )
SWT(Widget 소개 )
SWT(Layout 소개 )
영역을 나누는 방식 FillLayout, RowLayout, GridLayout
콘트롤을 붙이는 방식 FormLayout
한번에 하나의 콘트롤 보여지는 방식 StackLayout
SWT(Layout 소개 )
FillLayoutshell.setLayout(new FillLayout(SWT.VERTICAL));
shell.setLayout(new FillLayout());
SWT(Layout 소개 )
RowLayout
shell.setLayout(new RowLayout());
- 주요 Property wrap : 기본값은 true 이며 , 한줄로 유지 하고 싶을 경우에 false. pack : 기본값은 true 이며 , 기본 control 이 모두 . justify : 기본 값은 false 이며 , 부모 콘트롤 전반적으로 균등하게 배치 .- RowData(Width, Height) 특정 Widget 의 width, height 를 정의 .
SWT(Layout 소개 )
GridLayoutfinal Shell shell = new Shell();final GridLayout gridLayout = new Grid-Layout();gridLayout.numColumns = 3;shell.setLayout(gridLayout);
- GridData특정 Widget 의 정렬방식 및 영역 채우기 등의 방법을 지정 .
JFace (Viewer 소개 )
Viewer 는 ? Model, View, Control 을 분리 Sorting, Filtering Rendering (Icon, Label)
종류TableViewerTreeViewerListViewerComboViewerTextViewer
Viewer 소개
JFace(ContentProvider)
IStructuredContentProvider : Table, List 사용 Object[] getEmement(Object)
ITreeContentProvider : Tree 사용 Object[] getChildren(Object) : 자식 객체 리턴 getParent(Object) : 부모 객체 리턴 hasChildren(Object) : 자식 객체 유무
ILazyContentProvider : SWT.VIRTURAL
JFace(LabelProvider) ILabelProvider : Tree, List 사용
getImage(Object) : 해당 이미지 리턴 getText(Object) : 해당 텍스트 리턴
ITableLabelProvider : Table 사용 getColumnImage(Object, int) getColumnText(Object, int)
RAP Architecture
Server Side Client Side
RAP RCP
RWT == SWT & RWT != SWT qooxdoo -> RWT
개발환경 Setup 및 HelloWorld RAP
RAP 개발 환경
환경 JDK 6.x Eclipse RCP and RAP Developers(3.6.2)
rap target platform (runtime 1.4 RC3, 2011-06-04)
Jetty, Tomcat 6.x Tool :
WTP(Web Tool Project, v1.5) or ucloud ps IDE
https://hcs.ucloud.com/portal/ktcloudportal.epc.ucintro.ps.services.html
Target Platform 설정 개발환경과 실행환경 분리 . 버전 업에 따른 변화 대응 . 사용자 정의 lib 설정 및 공통 lib 정의 . 다양한 멀티 platform 의 변화 대응 .
Target Platform 설정 New -> Project
or New -> Target Definition
Help -> Welcome -> Rich Ajax Platform(RAP) -> Install Target Platform
HelloWorld RAP
New PlugIn Project
실행
방법
설정
실행환경 실행 할 플러그인 및
참조해야 할 plugin 설정 .
실행 할 plugin 을(com.study.rap.sam-ple) 를 선택한 후 Add Required Plugin-ins 선택 .
PDE 는 사용자 필요 plugins 을 자동을 추가 .
Validate Plug-ins 를 클릭하여 이상이 없다는 메시지가 출력되면 정상 .
실행환경
-console : 콘솔 모드로 시작 (osgi 커맨드 사용 )-consolelog : 콘솔에 로그를 출력
-Declipse.ignoreApp : 응용프로그램을 실행하지 않습니다 .
-Declipse.noShutdown : OSGi 가 종료되지 않는 한 프로그램을 종료하지 않습니다 .
HelloWorld RAP plugin.xml : plugin 정보를 수록 . MANIFEST.MF : Bundle 환경 파일로
plugin 이름 , 버전 ID, classpath, plugin 의존관계 정보 .
build.properties : 배포 시에 포함되어야 하는 리소스 정보 및 빌드 정보 정의 .
Application : Workbench, Application UI 시작 .
ApplicationWorkbenchAdvisor : Work-bench 의 시작과 종료를 관리 .
ApplicatonWorkbenchWindowAdvisor : menu, toolbar, StatusLine 등의 window 에 대해 정의 .
ApplicationActionBarAdvisor : menu, toolbar, Statusline 등의 실제를 구현 .
Perspective : 사용자 화면을 구성 .
Eclipse RAP 요소 살펴보기
HelloWorld RAP
Overview : plugin 정보 출력 . Dependencies : 사용할 plugin 을 정의 . Runtime : 외부 plugin 이 자신을 참조 할 수 있는지 여부와 외부 library(jar) 등을
정의 . Extensions : 외부 plugin 의 기능을 확장하기 위한 정의 . Extension Points : 자신의 기능을 확장하기 위한 확장 점을 정의 . Build : 배포 시에 포함되어야 하는 리소스 선택 . MANIFEST.MF : plugin.xml : build.properties :
Extensions and Extension Point
Eclipse 는 확장과 기증을 통해 개발합니다 . Extensions : Dependencies 에 정의된 plugin 기능을 확장하여
개발 . Extension Point : 자신이 구현한 기능을 외부 에서 확장하여 사용
할수 있도록 정의 .
이름 Extension 비고
Application 정의 org.eclipse.rap.ui.entrypoint
Perspectives 정의 org.eclipse.ui.perspectives
- Extension : RAP 시작 포인트
Startup Point
Extensions org.eclipse.rap.ui.entrypoint
Perspectives
• 현재 관점에서 보여 줄 화면 정의 및 배치 ( 사용자가 개발한 view 나 editor 및 참조한 plugin 에서 구현된 화면 ).
-Extensions org.eclipse.ui.perspectives
Commands and Actions 메뉴나 툴바를 이용하여
사용자에게 행위 부여 .
이미 정의된 기능을 사용할 수있도록 구현과 실행의 분리 .( 참조한 플러그인 및 내가 구현한 플러그인 )
목적 Extensions 비고
Workbench 와 window org.eclipse.ui.actionSets
Viewer org.eclipse.ui.viewActions
Editor org.eclipse.ui.editorActions
Menu org.eclipse.ui.popupMenus
commands org.eclipse.ui.commands
-Extension
Menu and Toolbar
전후 관계 표시 가능 : 예를 들어서 신규 추가 일 경우 -> menu:org.eclipse.ui.main.menu?after=additions 표시특 정 메뉴 뒤에 위치 하고자 할경우 after, 이전에 위치하고자 할 경우 before 를 사용할 수 있습니다 .
예를 들어 , menu:org.eclipse.ui.main.menu?after=com.study.sample.rcp.mainMenu.file
목적 Extension 비고Menu org.eclipse.ui.menus
Toolbar org.eclipse.ui.main.toolbar
View and Editor
Editor 모든 editor 가 공유하고 editor 영역
안에 위치한다 . editor 영역 안에서 분할은 가능하지만 Workbench Win-dow 를 벗어날 수 없다 .
주 메뉴와 메인 툴 바를 공유한다 사용자가 변경을 수행해도 바로 저장되지
않는다 . 명시적으로 요청해야 한다 .
- Extension
org.eclipse.ui.editors
Viewer 자신만의 메뉴와 툴바정의 .
드래그하여 Workbench Window 밖으로 빼낼 수 있다 .
- Extension
org.eclipse.ui.views
Selection Services Part 간의 이벤트 전달 사용 : public class TestViewer … implement ISelectionListener
서비스 등록 : getSite().setSelectionProvider( tableViewer ); 외부 서비스 실행 :
getSite().getPage().addSelectionListener(this);
종류 Viewer Type
ComboViewer IStructuredSelection
ListViewer ‘’
TreeViewer ‘’
-> CheckboxTreeViewer ‘’
TableViewer ‘’
-> CheckboxTableViewer ‘’
Job and UIJob Job 의 정의
public class JobExample extends Job
protected IStatus run(IProgressMonitor monitor) ;
public boolean belongsTo(Object lastName) ;
Job 의 실행 new JobExample().schedule();
Job 의 관리 IJobManager jobManager = Job.getJobManager();
Label Decorator
현재 Label 의 아이콘을 조건에 따라 변경 .
-Extension org.eclipse.ui.decorators
Preference Pages 시스템 환경변수 설정 정의 .
- Extension
org.eclipse.ui.preferen-cePages
org.eclipse.core.runtime.pref-erencs
Help Help -> Help Contents 메뉴
호출검색엔진 (Apache Lucene) 이
내장되어 검색 기능 .
F1 눌렀을 때 도움말 지원기능 .( 문맥감지 기능 )
다국어 지원 . 독립 실행 도움말 제공 .
Extension org.eclipse.help.toc org.eclipse.help.contexts
http://wiki.eclipse.org/RAP/FAQ#How_to_integrate_the_Eclipse_Help_System_in_a_RAP_application.3F
Themes(css)
Extension org.eclipse.rap.ui.themes
Branding
Extension org.eclipse.rap.ui.branding
지역화
Plugins -> PDE Tools -> Externalize Strings
Source code -> Externalize String…
Util 소개 (Resource Bundle Editor)
(http://sourceforge.net/projects/eclipse-rbe)
Exporting (Tomcat)
필요 Resource (RAP Deployment – Part 2: Deploying as WAR)
cvs(dev.eclipse.org) 에서 Checkout org.eclipse.equinox -> server-side -> bun-
dles org.eclipse.equnox.servletbridge ort.eclipse.equnox.http.servletbridge org.eclipse.equnox.http.registry
org.eclipse.rap -> releng org.eclipse.rap.demo.feature
cvs 와 연결끊기 자신의 update 프로젝트로 이름 변경
Exporting (Tomcat)
Context web.xml
JUnit
Dependencies : org.eclipse.rap.junit
RAP 장점 (RWT vs SWT)
RAP RCP
RAP 장점
Modularity~
Workbench JFace
RAP 장점 Single Source (RAP to RCP)
Tadpole RCPTadpole RAP
RAP 장점 Single Source (RCP to RAP)
Cubrid Manager RCP Cubrid Manager RAP
RAP 장점
Application
RWT (Server)
Servlet Container
RWT (Client)
Web Browserhttp
RAP 단점
Server 에 부하가 상대적으로 심하다 . Cloud 가 해결 방법이 될수 있을까 ?
GEF 지원 미흡 . Incubating -> port 에 코드 .( 버그 존재 , 느린속도 )
StyledText Widget 이 읽기 기능만 지원 . 읽기 기능만 가능 코드 .( 완전한 모듈은 기약없음 )
학습해야 할 요소가 많다 . Java -> SWT/JFace -> RCP -> Web -> RAP
Web 과 Desktop 과의 중간자로서 모호하다 . 개발시 기준 점을 잡아서 개발 해야함
RAP Incubator
PDERun-time
JITVisualiza-
tions
GoogleVisualiza-
tions
UploadWidget
SpreadSheet
Search
Demo
http://0.0.8.tadpole.tester.paas.wo.tc/db?startup=tadpoleKT PaaS(ucloud ps) 에 올려진 올챙이
참고자료 Eclipse RAP Home
Using Eclipse Ganymede to develop for the desktop, Web and mobile devices, Part 2: Developing for the Rich Client Platform, the Ganymede way
Rich Ajax Platform, Part 2: 애플리케이션 개발하기 Eclipse Rich Ajax Platform (RAP) - Tutorial with Eclipse 3.5 (Galileo)
Equinox in a Servlet Container
RAP Deployment – Part 2: Deploying as WAR
Single Sourcing RAP and RCP PPT
Eclipse con 2010
Eclipse con 2011
http://www.cubrid.com
http://pierocksmysocks.deviantart.com/art/Mobile-Device-Dock-Icons-64174438
http://www.devx.com/webdev/Article/36101/1763/page/3
https://cs.ucloud.com/portal/ktcloudportal.epc.ucintro.ps.services.html