Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.Presentation


    @Override
    public void update(final AnActionEvent pEvent) {
        if (pEvent == null)
            return;

        final Presentation p = pEvent.getPresentation();
        if (p == null)
            return;

        p.setEnabled(problem.isValid());
    }
View Full Code Here


        Project project = ActionUtil.getProject(component);
        return new SelectConnectionActionGroup(project);
    }

    public synchronized void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        String text = NAME;
        Icon icon = null;

        Project project = ActionUtil.getProject(e);
        VirtualFile virtualFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
        if (project != null && virtualFile != null) {
            FileConnectionMappingManager connectionMappingManager = FileConnectionMappingManager.getInstance(project);
            ConnectionHandler activeConnection = connectionMappingManager.getActiveConnection(virtualFile);
            if (activeConnection != null) {
                text = NamingUtil.enhanceUnderscoresForDisplay(activeConnection.getQualifiedName());
                icon = activeConnection.getIcon();
            }

            boolean isConsole = virtualFile instanceof SQLConsoleFile;
            presentation.setVisible(!isConsole);

            if (virtualFile.isInLocalFileSystem()) {
                DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
                DBSchemaObject editableObject = fileAttachmentManager.getEditableObject(virtualFile);
                if (editableObject != null) {
                    boolean isOpened = DatabaseFileSystem.getInstance().isFileOpened(editableObject);
                    presentation.setEnabled(!isOpened);
                }
            }
        }

        presentation.setText(text);
        presentation.setIcon(icon);
    }
View Full Code Here

            }
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Forward");

        Project project = ActionUtil.getProject(e);
        if (project != null) {
            DatabaseBrowserManager browserManager = DatabaseBrowserManager.getInstance(project);
            DatabaseBrowserTree activeTree = browserManager.getActiveBrowserTree();
            presentation.setEnabled(activeTree != null && activeTree.getNavigationHistory().hasNext());
        }
    }
View Full Code Here

            }
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Expand all");
    }
View Full Code Here

                    }
                }
            }
        }

        Presentation presentation = e.getPresentation();
        presentation.setText(text);
        presentation.setIcon(icon);
        presentation.setVisible(visible);
        presentation.setEnabled(enabled);
    }
View Full Code Here

            globalSettingsDialog.show();
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Settings");
    }
View Full Code Here

            }
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Back");

        Project project = ActionUtil.getProject(e);
        if (project != null) {
            DatabaseBrowserManager browserManager = DatabaseBrowserManager.getInstance(project);
            DatabaseBrowserTree activeTree = browserManager.getActiveBrowserTree();
            presentation.setEnabled(activeTree != null && activeTree.getNavigationHistory().hasPrevious());
        }
    }
View Full Code Here

            }
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Collapse all");
    }
View Full Code Here

    public void update(AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        if (project != null) {
            DDLFileAttachmentManager fileAttachmentManager = DDLFileAttachmentManager.getInstance(project);
            boolean hasBoundDDLFiles = fileAttachmentManager.hasBoundDDLFiles(object);
            Presentation presentation = e.getPresentation();
            presentation.setEnabled(hasBoundDDLFiles);
        }
    }
View Full Code Here

            loadContent(false);
        }

        @Override
        public void update(AnActionEvent e) {
            Presentation presentation = e.getPresentation();
            presentation.setEnabled(loadContentVisible);
            presentation.setText(loadContentCaption);
        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.Presentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.