use of com.intellij.uiDesigner.propertyInspector.PropertyInspectorTable in project intellij-community by JetBrains.
the class ShowJavadocAction method update.
public void update(final AnActionEvent e) {
final PropertyInspectorTable inspector = PropertyInspectorTable.DATA_KEY.getData(e.getDataContext());
e.getPresentation().setEnabled(inspector != null && inspector.getSelectedIntrospectedProperty() != null && inspector.getComponentClass() != null);
}
use of com.intellij.uiDesigner.propertyInspector.PropertyInspectorTable in project intellij-community by JetBrains.
the class ShowJavadocAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final PropertyInspectorTable inspector = PropertyInspectorTable.DATA_KEY.getData(e.getDataContext());
final IntrospectedProperty introspectedProperty = inspector.getSelectedIntrospectedProperty();
final PsiClass aClass = inspector.getComponentClass();
final PsiMethod getter = PropertyUtil.findPropertyGetter(aClass, introspectedProperty.getName(), false, true);
LOG.assertTrue(getter != null);
final PsiMethod setter = PropertyUtil.findPropertySetter(aClass, introspectedProperty.getName(), false, true);
LOG.assertTrue(setter != null);
final DocumentationManager documentationManager = DocumentationManager.getInstance(aClass.getProject());
final DocumentationComponent component1 = new DocumentationComponent(documentationManager);
final DocumentationComponent component2 = new DocumentationComponent(documentationManager);
final Disposable disposable = Disposer.newDisposable();
final TabbedPaneWrapper tabbedPane = new TabbedPaneWrapper(disposable);
tabbedPane.addTab(UIDesignerBundle.message("tab.getter"), component1);
tabbedPane.addTab(UIDesignerBundle.message("tab.setter"), component2);
documentationManager.fetchDocInfo(getter, component1);
documentationManager.queueFetchDocInfo(setter, component2).doWhenProcessed(() -> {
final JBPopup hint = JBPopupFactory.getInstance().createComponentPopupBuilder(tabbedPane.getComponent(), component1).setDimensionServiceKey(aClass.getProject(), DocumentationManager.JAVADOC_LOCATION_AND_SIZE, false).setResizable(true).setMovable(true).setRequestFocus(true).setTitle(UIDesignerBundle.message("property.javadoc.title", introspectedProperty.getName())).createPopup();
component1.setHint(hint);
component2.setHint(hint);
Disposer.register(hint, component1);
Disposer.register(hint, component2);
Disposer.register(hint, disposable);
hint.show(new RelativePoint(inspector, new Point(0, 0)));
//component1.requestFocus();
});
}
Aggregations