Bug 351634 - missing content after switching between perspectives
Summary: missing content after switching between perspectives
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2011-07-09 11:22 EDT by todor.georgiev CLA
Modified: 2019-11-14 03:47 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description todor.georgiev CLA 2011-07-09 11:22:12 EDT
Build Identifier: M20100909-0800

Hi,
I have 2 different perspectives on my RCP application
and when i switch between them the contents of both are missing,
if i close and reopen the views then everything is visible again...
what can be the cause of such behavior?
i'm using embedded SWT in both perspectives... 
best regars

Reproducible: Always
Comment 1 Remy Suen CLA 2011-07-09 14:55:01 EDT
(In reply to comment #0)
> i'm using embedded SWT in both perspectives... 

Embedded SWT? You mean embedded Swing?
Comment 2 todor.georgiev CLA 2011-07-09 15:55:19 EDT
ah i wrote swt...yes i mean SWING,and in the second perspective  i use a JInternalFrame:

Frame frame =SWT_AWT.new_Frame(composite);
JInternalFrame mainFrame =new JInternalFrame();
...
...
mainFrame.setSize(600, 600);
mainFrame.setVisible(true);
frame.add(mainFrame);
Comment 3 todor.georgiev CLA 2011-07-09 15:58:32 EDT
ah i wrote swt...yes i mean SWING,and in the second perspective  i use a JInternalFrame:

Frame frame =SWT_AWT.new_Frame(composite);
JInternalFrame mainFrame =new JInternalFrame();
...
...
mainFrame.setSize(600, 600);
mainFrame.setVisible(true);
frame.add(mainFrame);
Comment 4 todor.georgiev CLA 2011-07-09 16:40:53 EDT
i suspect it is because of low memory issues,cause
the second perspective has many panels with lots of widgets in them...
if i remove some of the widgets it gets a little better,the first 
switch is ok,then the contents disappear again...
Comment 5 Dani Megert CLA 2011-07-11 06:31:17 EDT
Anything in .log?
Comment 6 Oleg Besedin CLA 2011-07-11 09:44:11 EDT
Todor, can you attach a sample code that would allow us to duplicate the problem? I don't think we can do much without it.
Comment 7 Oleg Besedin CLA 2011-07-18 09:17:36 EDT
Please reopen if you can provide more info, see comment 5 and comment 6.
Comment 8 todor.georgiev CLA 2011-07-18 13:07:16 EDT
well i'm using this software:http://www.iu.hio.no/FaultCat/
i add the frame from it to a internal frame in the view  FaultTreeView which is in the perspective FaultTreePerspective,there is also another perspective: the MainPerspective,you can test it just with a empty perspective,then by switching between both perspective the components disappear...

 this is how my FalutTreeView looks like:
public void createPartControl(Composite parent) {
		b
		Composite composite= new Composite (parent,SWT.EMBEDDED|SWT.BACKGROUND);
		Frame frame =SWT_AWT.new_Frame(composite);
		JInternalFrame mainFrame =new JInternalFrame();
		JPanel panel=new JPanel();

		FUtil = new FileUtility();
           
        container =  mainFrame.getContentPane();
        gridLayout = new GridBagLayout();
        constraints = new GridBagConstraints();
        container.setLayout(gridLayout);
        
        infoPanel = new InfoPanel();
        details = new FaultTreeDetails(infoPanel);
        menuBar = new BrowserMenu();
        report = new Report();
        
        drawingArea = new DrawingArea(details, infoPanel, menuBar);
        generalToolBar = new GeneralToolBar(infoPanel, report,drawingArea);
        faultTreeToolBar = new FaultTreeToolBar(infoPanel);
        

        toolHolder1 = new JPanel();
        toolHolder2 = new JPanel();

        toolHolder1.add(generalToolBar);
        toolHolder2.add(faultTreeToolBar);


        viewPort = new JViewport();
        viewPort.setView(drawingArea);
        scroller = new JScrollPane(scroller.VERTICAL_SCROLLBAR_ALWAYS,
                      scroller.HORIZONTAL_SCROLLBAR_ALWAYS);
        
        scroller.setViewport(viewPort);
        
         
        addComponent(toolHolder1, 0, 0, 1, 1, constraints.WEST, 0, 0, constraints.NONE);
        addComponent(toolHolder2, 1, 0, 1, 1, constraints.WEST, 0, 0, constraints.NONE);
        addComponent(scroller, 2, 0, 1, 2, constraints.WEST, 2, 1, constraints.BOTH);
        addComponent(details, 2, 1, 0, 0, constraints.WEST, 0, 0, constraints.BOTH);
        addComponent(infoPanel, 4, 0, 2, 2, constraints.WEST, 0, 0, constraints.NONE);
        
      
        mainFrame.setJMenuBar(menuBar.getMenu());
        mainFrame.setSize(600, 600);
        mainFrame.setVisible(true);
        frame.add(mainFrame);
}
Comment 9 todor.georgiev CLA 2011-07-18 13:13:28 EDT
in the .log is nothing about it,the eclipse doesn't register it like a bug...
i think this is because of low memory ,i get constantly this windows messages about low memory...
Comment 10 todor.georgiev CLA 2011-07-18 13:20:58 EDT
sorry i add the internal frame to the SWT Frame...
and here is the whole code:


package com.example.rcpapp;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.MouseWheelEvent;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JViewport;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;

import FaultTree.*;

import org.apache.xerces.dom.*;
import org.apache.xerces.parsers.*;
import org.apache.xml.serialize.*;
import org.w3c.dom.*;

public class FaultTreeView extends ViewPart {
	
	public static final String ID="com.example.rcpapp.view4";

	  /**
     * The fault tree toolbar.
     */
   private FaultTreeToolBar faultTreeToolBar;

   /**
     * The general toolbar.
     */
   private GeneralToolBar generalToolBar;

   /**
     * The drawing area.
     */
   public DrawingArea drawingArea;

   /**
     * The fault tree details panel.
     */
   private FaultTreeDetails details;

   /**
     * The menubar.
     */
   private BrowserMenu menuBar;

   /**
     * The infopanel.
     */
   private InfoPanel infoPanel;

   /**
     * The report panel.
     */
   private Report report;

   /**
     * Panel that holds the general toolbar.
     */
   private JPanel toolHolder1;

   /**
     * Panel that holds the fault tree toolbar.
     */
   private JPanel toolHolder2;

   /**
     * The introscreen panel.
     */
   private IntroScreen introScreen;


   /**
     * The JFrame container.
     */
   private Container container;

   /**
     * The gridbaglayout for the JFrame.
     */
   private GridBagLayout gridLayout;

   /**
     * The gridbag constraints.
     */
   private GridBagConstraints constraints;

   /**
     * The scrollbars for the drawing area.
     */
   private JScrollPane scroller;

   /**
     * The viewport on the drawing area.
     */
   private JViewport viewPort;
   /**
    * The FileUtility for opening the xmi files
    */
   private FileUtility FUtil;
	
	
	public FaultTreeView() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void createPartControl(Composite parent) {
		Composite composite= new Composite               (parent,SWT.EMBEDDED|SWT.BACKGROUND);
		Frame frame =SWT_AWT.new_Frame(composite);
		JInternalFrame mainFrame =new JInternalFrame();
		JPanel panel=new JPanel();
		//FaultTreeBrowser browser = new FaultTreeBrowser();
		//frame.add(browser);
		FUtil = new FileUtility();
           
        container =  mainFrame.getContentPane();
        gridLayout = new GridBagLayout();
        constraints = new GridBagConstraints();
        container.setLayout(gridLayout);
        
        infoPanel = new InfoPanel();
        details = new FaultTreeDetails(infoPanel);
        menuBar = new BrowserMenu();
        report = new Report();
        
        drawingArea = new DrawingArea(details, infoPanel, menuBar);
        generalToolBar = new GeneralToolBar(infoPanel, report,drawingArea);
        faultTreeToolBar = new FaultTreeToolBar(infoPanel);
        

        toolHolder1 = new JPanel();
        toolHolder2 = new JPanel();

        toolHolder1.add(generalToolBar);
        toolHolder2.add(faultTreeToolBar);


        viewPort = new JViewport();
        viewPort.setView(drawingArea);
        scroller = new JScrollPane(scroller.VERTICAL_SCROLLBAR_ALWAYS,
                      scroller.HORIZONTAL_SCROLLBAR_ALWAYS);
        
        scroller.setViewport(viewPort);
        
         
        addComponent(toolHolder1, 0, 0, 1, 1, constraints.WEST, 0, 0, constraints.NONE);
        addComponent(toolHolder2, 1, 0, 1, 1, constraints.WEST, 0, 0, constraints.NONE);
        addComponent(scroller, 2, 0, 1, 2, constraints.WEST, 2, 1, constraints.BOTH);
        addComponent(details, 2, 1, 0, 0, constraints.WEST, 0, 0, constraints.BOTH);
        addComponent(infoPanel, 4, 0, 2, 2, constraints.WEST, 0, 0, constraints.NONE);
        
        mainFrame.setJMenuBar(menuBar.getMenu());
        
     
       mainFrame.setSize(600, 600);
        
        mainFrame.setVisible(true);
     
	
        frame.add(mainFrame);

	}

	private void addComponent(Component c, int row, int column, int width,
	        int height, int anchor, int weightx, int weighty, int fill) {

	        constraints.gridx = column;
	        constraints.gridy = row;

	        constraints.gridwidth = width;
	        constraints.gridheight = height;

	        constraints.weightx = weightx;
	        constraints.weighty = weighty;

	        constraints.anchor = anchor;
	        constraints.fill = fill;

	        gridLayout.setConstraints(c, constraints);
	        container.add(c);
	    }
Comment 11 Oleg Besedin CLA 2011-07-20 10:42:00 EDT
Passing to SWT.
Comment 12 todor.georgiev CLA 2011-07-23 14:35:46 EDT
ok thanks that you took teh tiem to answer,
can you suggest a solution?
cause not using SWT and Swing together is not the best solution...
Comment 13 Lars Vogel CLA 2019-11-14 03:47:07 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.