JRexCanvas in framework
Cusco <[email protected]> Thu, 21 Dec 2006 00:14:58 -0800 (PST)
| Newsgroups | gmane.comp.mozilla.jrex |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have a problem with the JRexCanvas on a panel. At my work, we've created a
complete framework in Java and Eclipse 3.2 called Jef.
In Jef I have made a panel which contains a JRexBrowser without StatusBar,
MenuBar, ProgressBar, .... When used in a application, the top of the
application is a grid containing URL's, the bottom half is containing my
JBrowsePanel. The framework is an MDI application with his own menusystem
etc... . When I take the browserapplication the application doesn't go out
of the bounds of Jef, but the JrexBrowser stays on top on can go "out" of
Jef. Everything goes fine except that the JRexBrowser stays "above" the
framework.
Is there a way to fix this? I also noticed that when I drag my
browserapplication, everything follows smoothly, except the browser which
stays behind a fraction of a second. Another thing that happens at
WinManager.init(this) is that he resizes the complete framework and changes
the title of Jef to his own title.
Source of JBrowsePanel:
public class JBrowsePanel extends JPanel {
public JBrowsePanel () {
super(new BorderLayout());
browser = new Browser();
add(browser,BorderLayout.CENTER);
}
protected class Browser extends JPanel {
public Browser() {
super(new BorderLayout());
}
/**
* This methods browses to the given URL. The JRex engine is started the
first time.
* Called every time the URL is changed in
the grid
* @param uri
*/
public void setBrowser(String uri) {
if (uri == null || uri.trim().length() == 0 ||
uri.equals(JBrowsePanel.this.currentUri))
return;
// Reset the progressbar
progressBar.setValue(0);
progressBar.setIndeterminate(false);
// When not started we need to start the engine and do the settings
if (winManager == null) {
// start the JRex XPCOM engine.
try {
JRexFactory.getInstance().startEngine();
JRexPreference prefs = JRexPreference.getInstance();
} catch (JRexException e) {
e.printStackTrace();
}
// Get the JRex WindowManager implementation.
winManager =
(JRexWindowManager)JRexFactory.getInstance().getImplInstance(JRexFactory.WINDOW_MANAGER);
// Create the JRex WindowManager with desired window mode.
winManager.create(JRexWindowManager.INTERNAL_PANE_MODE);
// Store the actual size of the window because the init of
winManager is going to resize
Window window = SwingUtilities.windowForComponent(this);
Dimension size = window.getSize();
// Init the window manager with a parent component where JRex
browser sits, if component is null then a new JFrame will be used.
winManager.init(this);
// After the init we restore the size back to normal
window.setSize(size);
}
jRexCanvas = (JRexCanvas) winManager.getBrowserForParent(this);
WebNavigation navigation = jRexCanvas.getNavigator();
try {
progressBar.setIndeterminate(true);
navigation.loadURI(uri, WebNavigationConstants.LOAD_FLAGS_NONE, null,
null, null);
JBrowsePanel.this.currentUri = uri;
} catch (JRexException e) {
e.printStackTrace();
}
}
}
--
View this message in context: http://www.nabble.com/JRexCanvas-in-framework-tf2864266.html#a8004239
Sent from the MozDev - jrex mailing list archive at Nabble.com.