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 8466003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:12:52+00:00 2026-06-10T15:12:52+00:00

how do I access to an Object of a View from somewhere else? (Following

  • 0

how do I access to an Object of a View from somewhere else?

(Following code is just to sketch what i want to do)

public class View extends ViewPart {

    public static final String ID = "view";
    private static List list;

    public View() {
    }

    @Override
    public void createPartControl(Composite parent) {
        list = new List(parent, SWT.BORDER);
    }

    @Override
    public void setFocus() {
    }

    public static void addToList(String string) {
        list.add(string);
    }
}

Now I want be able to use View.addToList("Message") anywhere in the application.

  • 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-06-10T15:12:54+00:00Added an answer on June 10, 2026 at 3:12 pm

    Use the following code snippet, and replace [ID] with the id you specified for your view in plugin.xml.

    IViewPart viewPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView( [ID] );
    

    The id is usually in the form of com.domain.something.viewName and can be found under your view contribution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How does one access, in code, a view they dragged from the Object Browser
Should I access global db object directly from within the methods of each class?
i cant access clicked object(this) parent's class.. click same elements and different returns? this
I neet access to current object in a static method. Code: protected static $name;
I'm using Pyramid framework and I want to access the IP address from which
I need to create an (archetypes) object from a View of a second object
i wrote a View class based on ViewSwitcher and now I want to write
How can i access a button which is present in a view ,from any
I am trying to access a view inside a splitter from my mainframe. At
I am looking for a way that allows me access an object from another

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.