Page 1 of 2 12 LastLast
Results 1 to 20 of 37
  1. #1
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default Multiple views on user interface application

    How to create in Eclipse SWT a GUI with multiple scrollable views?

    Thanks!

    Best regards.


    Dan
    Attached Thumbnails Attached Thumbnails Multiple views on user interface application-userinterface.jpg  

  2. #2
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    I made a window only with a View. But further I do not manage. Can someone help me?

    I must make 4 "Views" : one to the left of (0.18f), 3 rechts(0.18f; 0.5f; 0.04f)


    Thanks
    Attached Files Attached Files

  3. #3
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Hi,

    Make 4 views from plugin.xml then
    add these view to perspective of ur rcp project

    public class Perspective implements IPerspectiveFactory {

    public void createInitialLayout(IPageLayout layout) {
    String editorArea = layout.getEditorArea();
    layout.setEditorAreaVisible(false);
    layout.setFixed(true);

    layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 0.2f, editorArea);
    layout.addStandaloneView("testproject.view1", false, IPageLayout.TOP, 0.2f, editorArea);
    layout.addStandaloneView("testproject.view2", false, IPageLayout.LEFT, 0.2f, editorArea);

    }

    }


    Regards ,
    vinay

  4. #4
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    Thank you for the answer. I have tried but I didn't had success. Can you make an working example and upload it her (modify my application from archive)?

    Thanks,

    Regards,

    Dan

  5. #5
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Send me the code of ur perspective.class n plugin.xml , I will make changes for u . Have u done entry of views in plugin.xml.

    Regards,
    trax

  6. #6
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    Hi, I have tried but it is not working.

    Code for perspective.class

    Java Code:
    package howdyrcp;
    
    import org.eclipse.ui.IPageLayout;
    import org.eclipse.ui.IFolderLayout;
    import org.eclipse.ui.IPerspectiveFactory;
    
    public class Perspective implements IPerspectiveFactory {
    		
    	
    	
    	
    	public void createInitialLayout(IPageLayout layout) {
    		String editorArea = layout.getEditorArea();
    		layout.setEditorAreaVisible(false);
    		layout.setFixed(true);
    		
    		//layout.addStandaloneView(View.ID,  false, IPageLayout.LEFT, 1.0f, editorArea);
    		layout.addStandaloneView(View.ID,  false, IPageLayout.LEFT, 0.18f, editorArea);
    		
    
    	}
    
    }
    Code for plugin.xml

    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <?eclipse version="3.2"?>
    <plugin>
    
       <extension
             id="application"
             point="org.eclipse.core.runtime.applications">
          <application>
             <run
                   class="howdyrcp.Application">
             </run>
          </application>
       </extension>
       <extension
             point="org.eclipse.ui.perspectives">
          <perspective
                name="Perspective"
                class="howdyrcp.Perspective"
                id="HowdyRCP.perspective">
          </perspective>
       </extension>
       <extension
             point="org.eclipse.ui.views">
          <view
                name="View"
                class="howdyrcp.View"
                id="HowdyRCP.view">
          </view>
       </extension>
       <extension
             id="product"
             point="org.eclipse.core.runtime.products">
          <product
                application="HowdyRCP.application"
                name="Howdy RCP Application">
             <property
                   name="windowImages"
                   value="icons/alt_window_16.gif,icons/alt_window_32.gif">
             </property>
          </product>
       </extension>
    
    </plugin>

    If you have Eclipse you can use the projekt from the archive.

    Thank's


    Dan

  7. #7
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Change the perspective classs:

    package howdyrcp;

    import org.eclipse.ui.IPageLayout;
    import org.eclipse.ui.IFolderLayout;
    import org.eclipse.ui.IPerspectiveFactory;

    public class Perspective implements IPerspectiveFactory {




    public void createInitialLayout(IPageLayout layout) {
    String editorArea = layout.getEditorArea();
    layout.setEditorAreaVisible(false);
    layout.setFixed(true);

    layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 0.18f, editorArea);

    layout.addStandaloneView("HowdyRCP.view1", false, IPageLayout.TOP, 0.2f, editorArea);

    layout.addStandaloneView("HowdyRCP.view2", false, IPageLayout.LEFT, 0.2f, editorArea);


    }

    }

  8. #8
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    change the plugin.xml text to:

    <?xml version="1.0" encoding="UTF-8"?>
    <?eclipse version="3.2"?>
    <plugin>

    <extension
    id="application"
    point="org.eclipse.core.runtime.applications">
    <application>
    <run
    class="howdyrcp.Application">
    </run>
    </application>
    </extension>
    <extension
    point="org.eclipse.ui.perspectives">
    <perspective
    name="Perspective"
    class="howdyrcp.Perspective"
    id="HowdyRCP.perspective">
    </perspective>
    </extension>
    <extension
    point="org.eclipse.ui.views">
    <view
    name="View"
    class="howdyrcp.View"
    id="HowdyRCP.view">
    </view>
    </extension>
    <extension
    point="org.eclipse.ui.views">
    <view
    name="View1"
    class="howdyrcp.View1"
    id="HowdyRCP.view1">
    </view>
    </extension>
    <extension
    point="org.eclipse.ui.views">
    <view
    name="View2"
    class="howdyrcp.View2"
    id="HowdyRCP.view2">
    </view>
    </extension>

    <extension
    id="product"
    point="org.eclipse.core.runtime.products">
    <product
    application="HowdyRCP.application"
    name="Howdy RCP Application">
    <property
    name="windowImages"
    value="icons/alt_window_16.gif,icons/alt_window_32.gif">
    </property>
    </product>
    </extension>

    </plugin>

  9. #9
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    and add two classes in ur source code in howdyrcp package as View1 n View2 n copy the code written in howdyrcp.View In both of the classes.
    If u hav more problems , feel free to contact.
    Regards,
    trax

  10. #10
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    It's not working. By compiling I obtain only one view.

  11. #11
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    It's working. Was my mistake.

    Thank's

    Regards


    Dan

  12. #12
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Similarly U can add as many views in different forms in ur perspective.

  13. #13
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    Thank you. With your help I have finished the first step.

    Further I have to add a dynamic help to this RCP example.
    I have to activate the help with "F1" and when I click one the one view appear the message for the selected view, when i click into other view i have to become the text help for the selected view.

    I know that it is another thema but you know to work with Eclipse and you are the only who had posted an answer to my questions.

    When do you know something that can help me, or you know how to do this, please help me.

    Best regards ,

    Dan

  14. #14
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    I can help u but plz be more specific with ur requirements , I m nt able to understand what u want , i just understanded that u want that help should be activated when u press F1 but what kind of help do u want to open any dialog box for it or in another form plz expalin:)

    regards,
    trax

  15. #15
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    I have to make something that looks an works similar with dynamic help from Eclipse. When you open the Eclipse and press F1 appear a window with related topics. When you select for example package explorer in the help window appear "about package explorer" and so works for others view from Eclipse.

    For my application i have to buid a such dynamic help. I hope that I have good explained.

    Thanks

    Dan

  16. #16
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    This code will solve ur problem:)

    parent.addKeyListener(new KeyAdapter(){

    @Override
    public void keyPressed(KeyEvent event) {
    if(event.keyCode == SWT.F1){
    // Your code
    }

    }

    });

  17. #17
    dand_dd is offline Member
    Join Date
    Mar 2009
    Posts
    19
    Rep Power
    0

    Default

    Where I have to add this code?


    Dan

  18. #18
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    1st u tell me what widgets you including in ur views.

    trax

  19. #19
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    Try this out :)

    public void createPartControl(Composite parent) {
    parent.getShell().addKeyListener(new KeyAdapter(){

    @Override
    public void keyPressed(KeyEvent event) {
    if(event.keyCode==SWT.F1){
    //your code
    }

    }
    });

    }

    regards,
    trax

  20. #20
    trax is offline Member
    Join Date
    Mar 2009
    Posts
    42
    Rep Power
    0

    Default

    This method u will find in ur view class if u had implemented viewpart interface.

Page 1 of 2 12 LastLast

Similar Threads

  1. User Interface
    By swikar.java in forum Advanced Java
    Replies: 16
    Last Post: 12-09-2008, 03:37 PM
  2. Multiple line user input
    By jointhelabel in forum New To Java
    Replies: 3
    Last Post: 10-26-2008, 03:41 AM
  3. J2ME User Interface Developer
    By mobileapps in forum Jobs Offered
    Replies: 0
    Last Post: 10-03-2008, 01:43 PM
  4. user interface development using JSP
    By pradeep1_mca@yahoo.com in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 06-02-2008, 02:48 PM
  5. Help user interface
    By carl in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •