Analysis
(Give as much as possible of the needed information for designing and implementing the task in the following sections.)
Overview
The purpose of this task is to give the user possibility to add frames with embedded browser content, that gives the opportunity to embed certain website in frame of the book.
Task requirements
- Because the browser frame is actually a new kind of frame new entry in the insert menu must be created for it.
- The browser content must appear inside the created frame
- most of the frames are going to be smaller than the browser content, so a scrollbars must appear when this is necessary.
- a status bar for the page must be displayed in the bottom of the frame
- (optional) a possibility to turn on/off the status bar is a good idea
- When the browser frame is active it must behave just like a browser
- the scroll of the mouse must be recognizable, and result in navigation through the browser content
- on right click same options as on the system browser must be provided (e.g. refresh, encoding, print, etc.)
Task result
The result of this task must be a source code.
Implementation idea
- This is a sample picture of how should browser frame must look like (the 3rd frame with google in it).
- http://djproject.sourceforge.net/ns/DJNativeSwingDemo.jnlp
- you can look at Additional Features -> Constraint Visibility
Related
How to demo
Create a browser frame, navigate through it, and try doing other things, that are possible when opening this page with your browser.
Design
- Create new module - org.sophie2.extra.func.browser.
- Create class BrowserModule in org.sophie2.extra.func.browser package.
- In org.sophie2.extra.func.browser.model package
- Create class BrowserContentProvider that implements FrameContentProvider and will create a frame with browser content by given browser resource.
- Create class BrowserFrameContent that extends FrameContent.
- In org.sophie2.extra.func.browser.view package
- Create class InsertBrowserItem that extends AppMenuItem and after clicked a frame with browser content will be inserted to the current book.
- Create class BrowserContentView that extends FrameContentView.
- Create class BrowserContentViewProvider that implements FrameContentViewProvider.
- Create class BrowserResourcePreview that implements ResourcePreviewProvider.
- In org.sophie2.extra.func.browser.view.logic
- Create class BrowserLogic that implements OperationDef
For this implementation we will use NativeSwing library from DJ Library (http://djproject.sourceforge.net/ns/index.html). This means that we will be SWT (http://www.eclipse.org/swt/) dependant (NaiveSwing depends on SWT). SWT is a widget library that gives access to native widgets of the platform for which is implemented. Depending on SWT means that either we should have Sophie build for every platform we support or we will include all SWT implementations in one Sophie2 build and hope that NativeClassLoader will instantinate the one that is needed. Another thing is that for Linux systems it is implemented with GTK (http://www.gtk.org) and Motif (http://www.opengroup.org/motif). I guess we will choose GTK implementation but what about other GUI users (like Qt for example). What I mean is that it is unclear what is "native" graphical widget in Linux...
Also when the browser frame is active it won't behave like a browser. It can open web pages and that's all...
Implementation
- Commited to trunk at [3779]
Testing
(Place the testing results here.)
Comments
Current pom.xml file supports this functionality only on 32 bit linuxes
Attachments
- content.png (25.9 KB) - added by todor 16 years ago.