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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:16:53+00:00 2026-06-12T11:16:53+00:00

I develop extension of PDT plugin. I need dialog with interfaces only (not classes).

  • 0

I develop extension of PDT plugin. I need dialog with interfaces only (not classes). Basic code looks like it:

OpenTypeSelectionDialog2 dialog = new OpenTypeSelectionDialog2(
    DLTKUIPlugin.getActiveWorkbenchShell(), 
    multi, 
    PlatformUI.getWorkbench().getProgressService(), 
    null, 
    type, 
    PHPUILanguageToolkit.getInstance());

It’s works fine but I get classes and interfaces together (type variables). Is any method to filter it? I can’t find this kind of mechanism in PDT but classes and interfaces are recognize correctly (icons next to names).

  • 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-12T11:16:54+00:00Added an answer on June 12, 2026 at 11:16 am

    I don’t know if its the best solution but it works.

    int falseFlags = 0;
    int trueFlags = 0;
    
    IDLTKSearchScope scope = SearchEngine.createSearchScope(getScriptFolder().getScriptProject());
    
    trueFlags = PHPFlags.AccInterface;
    
    OpenTypeSelectionDialog2 dialog = new OpenTypeSelectionDialog2(
        DLTKUIPlugin.getActiveWorkbenchShell(), 
        multi,
        PlatformUI.getWorkbench().getProgressService(), 
        scope, 
        IDLTKSearchConstants.TYPE,
        new PHPTypeSelectionExtension(trueFlags, falseFlags), 
        PHPUILanguageToolkit.getInstance());
    

    And PHPTypeSelectionExtension looks like this:

    public class PHPTypeSelectionExtension extends TypeSelectionExtension {
    
    /**
     * @see PHPFlags
     */
    private int trueFlags = 0;
    private int falseFlags = 0;
    
    public PHPTypeSelectionExtension() {
    }
    
    public PHPTypeSelectionExtension(int trueFlags, int falseFlags) {
        super();
        this.trueFlags = trueFlags;
        this.falseFlags = falseFlags;
    }
    
    @Override
    public ITypeInfoFilterExtension getFilterExtension() {
        return new ITypeInfoFilterExtension() {
            @Override
            public boolean select(ITypeInfoRequestor typeInfoRequestor) {
                if (falseFlags != 0 && (falseFlags & typeInfoRequestor.getModifiers()) != 0) {
    
                    // Try to filter by black list.
                    return false;
                } else if (trueFlags == 0 || (trueFlags & typeInfoRequestor.getModifiers()) != 0) {
    
                    // Try to filter by white list, if trueFlags == 0 this is fine 'couse we pass black list.
                    return true;
                } else {
    
                    // Rest is filter out.
                    return false;
                }
            }
        };
    }
    
    @SuppressWarnings("restriction")
    @Override
    public ISelectionStatusValidator getSelectionValidator() {
        return new TypedElementSelectionValidator(new Class[] {IType.class, INamespace.class}, false);
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going to develop a Firefox extension which uses some Java classes. The extension
I need to develop small AIR extension for iOS. here's the question: is it
I would like to develop a browser extension for all major browsers. From what
I am trying to develop a Firefox extension. The following code: var divList =
I'm wondering, how can I develop application/plugin/browser extension that can extend functionality of search
I am trying to develop a plugin/extension for a browser (Firefox or IE or
I want to develop a certain plugin/extension, which needs to run in eclipse and
I would like to develop a chrome extension/application from my java application. Is this
Hi I'd like to run & develop an ISAPI extension in IIS Express 7.5
I am trying to develop an extension that will work with Awesome New Tab

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.