Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 689335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:19:19+00:00 2026-05-14T02:19:19+00:00

i have one perspective and one viewpart. The viewpart is shown as soon as

  • 0

i have one perspective and one viewpart. The viewpart is shown as soon as the program opens.
The viewpart should be the only one and should be closeable.

I have two problems with that behaviour:

  1. I want the perspective to be
    shown empty, just a background image
    should being shown. (How do I do that?)
  2. I want to open the
    viewpart from the menu, using the
    command style menu.

So far I can close my viewpart and the perspective is empty.

but

I can not call it from the menu with my selfdefined command.
The code is like

public class CallMyViewPart extends AbstractHandler implements IHandler {

    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {
        Shell shell = HandlerUtil.getActiveWorkbenchWindow(event).getShell();
        IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();

        MyViewPart myViewPart = new MyViewPart();

    return null;
    }
}

What am I doing wrong?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:19:19+00:00Added an answer on May 14, 2026 at 2:19 am

    Well, it was easier than I thought.

    public class CallMyViewPart extends AbstractHandler implements IHandler {      
    
        @Override      
        public Object execute(ExecutionEvent event) throws ExecutionException {      
            Shell shell = HandlerUtil.getActiveWorkbenchWindow(event).getShell();      
            IWorkbenchPage page = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
            try {
            page.showView("somedomain.mainViewpart");
        } catch (PartInitException e) {
            e.printStackTrace();
        }
    
        return null;      
        }      
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that only crashes for one of my tester’s - no
From a practical and best practices perspective, should rails models that have HABTM association
have one time consuming step that flattens a bunch of files. basically i'd like
I have one user (only one, all the others are fine) trying to update
I have one drop down list in my page, which contains two options. What
I have two tables. One contains a list of products with the primary key
We have a mostly 2D game that runs in orthographic mode, but one part
I have a problem when rendering cubes in OpenGL.I am drawing two cubes, one
All, I basically have two identical pages from a coding perspective. The first page
Background: I have a gtk client that uses twisted and perspective broker to perform

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.