How to check setting dialog already open

Hi Team,

I need to check whether 'Setting' dialog is already open and if it is open need to close. Is there any api method available for that?

 

Thanks,

Navin

9 comments
Comment actions Permalink
Official comment

Hi Navin,

This is a wrong behaviour. You should not control the Setting dialog, because your plugin may break something.

For example, user may have modified settings for other plugins which are not saved yet.

I think, you should provide a Component via Configurable.createComponent, which changes its state according your expectations.

Thanks, SAM

Comment actions Permalink

This is not possible via public API. What problem are you trying to solve?

0
Comment actions Permalink

Hi Yann,

Please refer https://intellij-support.jetbrains.com/hc/en-us/community/posts/206752735-Setting-dialog-open-twice?input_string=How%20to%20check%20setting%20dialog%20already%20open

I have able to resolve issue mentioned in above link by following the guidance provided. Issue came with IntelliJ new version 2016.1.x

 

When you click 'Test1' or 'Test2', password dialog appears. If user not remember his password user can erase and recreate new one. Once user forget the password it won't showing relevant component (works with 14.x).

Contenets are rendered successfuly when I close the setting dialog and come. So I'm thinking, when user forget the password close the 'Setting' dialog and reopen again.

 

Thanks,

Navin

 

 

 

0
Comment actions Permalink

Hi SAM,

 

Thanks for the reply. I have done as you suggested, but component not rendering when click on tree nodes :(.  It will rendered the what I need, but not executing createComponent().

Is it possible to register/unregister applicationConfigurable without using plugin.xml(code level)?

 

Stuck with this issue for days :( 

Thanks.

Navin Amarasiri

0
Comment actions Permalink

Hi Navin,

There is some information about configurables:
https://sites.google.com/site/malenkov/java/150403

In short, the createComponent is called only once.
You can add ComponentListener to you component
to detect when it is shown or hidden.

Thanks,
SAM

0
Comment actions Permalink

> Is it possible to register/unregister applicationConfigurable without using plugin.xml(code level)?

No, it is not possible. Why do you cannot use plugin.xml?

0
Comment actions Permalink

Hi SAM,

I further debug and found out the followings with my plugin;

  1. When user select nodes in my plugin, CardLayoutPanel.select(ActionCallback callback, K key, UI ui) will call.
  2. It will add components to myContent if not not containing any.


For my scenario Credential dialog appear when user selecting a node. If user canceled it will return null and select parent element.

I noticed that in version 14.x, my plugin component will be added if user success with Credential. Therefore plugin works fine with version 14.x. But in 2016.x when user cancel the Credential, component will be added to the myContent with a default panel. I believe that would be the reason contents are not being loaded when user click again (Like you mentioned createComponent is called only once and components added to the myContent).

 

Is it possible to disposed/remove component from myContent?

highly appreciate your thoughts on this.

 

Thanks

Navin Amarasiri

 

 

0
Comment actions Permalink

Hi Navin,

As I said before, the createComponent is called only once.

> For my scenario Credential dialog appear when user selecting a node.
> If user canceled it will return null and select parent element.

This is a bad scenario. You must not force user what to do! I'm already described why:
http://intellij-support.jetbrains.com/hc/en-us/community/posts/206749815-How-to-capture-event-when-click-child-nodes-in-Setting-page

For you plugin I recommend you to create a panel with card layout.
This panel may have 2 components:
1. Panel to enter some credential (from current dialog)
2. Panel to control settings

If credential are not set the first panel is shown,
otherwise the second one is shown.

In this case your plugin will not affect other settings
and will not annoy users by opening a dialog.

Thanks,
SAM

0
Comment actions Permalink

Thanks for the explanation. Sorry for troubling you :) 

0

Please sign in to leave a comment.