Hi Joe,

you should get the berry::IEditorInput from the berry::IEditorPart. The IEditorInput represents the model source for the editor part. Usually, you supply your own editor input, subclassed from IEditorInput (or for simple cases, use the existing concrete class berry::FileEditorInput). You can then query the IEditorInput if the source exists, get it's name, or cast the class to your subclass an call whatever method you want to determine the model state of the editor.


Best,

Sascha

On 03/30/2011 07:47 PM, Joe wrote:

Hi Mitk Users,

I was able to figure out how to save 2 data sets. I saved in separate .mitk files. Please do not help me with the problem below (Message 3).

I now have a new problem. How can you tell if an IEditorPart is empty or is showing a file?

I tried:

1) GetEditorSite()

2) then casting IEditorSite to EditorSite

3) then calling EditorSite->GetEditorDescriptor()

4) then casting IEditorDescriptor to EditorDescriptor

5) then calling EditorDescriptor->GetFileName()

But this does not compile; probably because of internal classes.

Sincerely,

Joe

------------------------------------------------------------------------

*From:*Joe [mailto:[email protected]]
*Sent:* Tuesday, March 29, 2011 11:37 AM
*To:* '[email protected]'
*Cc:* Gary Carter
*Subject:* Re: [mitk-users] Two data sets in different render widgets of the QMitkStdMultiWidget

Message: 3

Date: Tue, 29 Mar 2011 11:37:02 -0700

From: "Joe" <[email protected]>

Subject: Re: [mitk-users] Two data sets in different render widgets of

      the   QMitkStdMultiWidget

To: <[email protected]>

Cc: Gary Carter <[email protected]>

Message-ID: <[email protected]>

Content-Type: text/plain; charset="us-ascii"

Hi Mitk Users,


  *We implemented “Re: [mitk-users] Two data sets in different render
  widgets of the QMitkStdMultiWidget” (*Wed, 13 Oct 2010 07:49:03 -0700):

/- Instantiate a separate mitk::DataStorage object (as Jochen suggested) and insert your second dataset. Then you could open a second QMitkStdMultiWidget which renders your separate mitk::DataStorage contents by calling: ///

/  /
/// Implement the mitk::IDataStorageReference interface/
/class MyDataStorageRef : public mitk::IDataStorageReference/

/{ ... } // see the internal class mitkDataStorageReference class for an example ///

/  /
/mitk::IDataStorageReference myDataStorageRef = new MyDataStorageRef(...);/

/mitk::DataStorageEditorInput::Pointer myDataStorageInput = new mitk::DataStorageEditorInput(myDataStorageRef); berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->OpenEditor(myDataStorageInput, QmitkStdMultiWidgetEditor::EDITOR_ID); /

//

Now I am trying to save the 2 data sets in a “.mitk” file. The problem is that in QmitkExtFileSaveProjectAction::Run(), the following is called:

berry::IEditorPart::Pointer editor = m_Window->GetActivePage()->GetActiveEditor();

to access the editor. How can I access the 2nd editor to save both in the file?

Sincerely,

Joe Giacomini


  **


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to