Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.Presentation


import javax.swing.JComponent;

public class SelectDatasetFilterComboBoxAction extends DBNComboBoxAction {
    public SelectDatasetFilterComboBoxAction() {
        Presentation presentation = getTemplatePresentation();
        presentation.setText("No Filter");
        presentation.setIcon(Icons.DATASET_FILTER_EMPTY);
    }
View Full Code Here


    @Override
    public void update(AnActionEvent e) {
        DatasetEditor datasetEditor = AbstractDataEditorAction.getDatasetEditor(e);

        Presentation presentation = e.getPresentation();
        boolean enabled =
                datasetEditor != null &&
                !datasetEditor.isInserting() &&
                !datasetEditor.isLoading();
        if (datasetEditor != null) {
            DBDataset dataset = datasetEditor.getDataset();

            if (dataset != null) {
                DatasetFilterManager filterManager = DatasetFilterManager.getInstance(dataset.getProject());
                DatasetFilter activeFilter = filterManager.getActiveFilter(dataset);

                if (activeFilter == null) {
                    presentation.setText("No Filter");
                    presentation.setIcon(Icons.DATASET_FILTER_EMPTY);
                } else {
                    //e.getPresentation().setText(activeFilter.getName());
                    presentation.setText(NamingUtil.enhanceNameForDisplay(activeFilter.getName()));
                    presentation.setIcon(activeFilter.getIcon());
                }
            }
        }

        //if (!enabled) presentation.setIcon(null);
        presentation.setEnabled(enabled);
    }
View Full Code Here

        }
    }

    @Override
    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setIcon(filter.getIcon());
        presentation.setText(NamingUtil.enhanceNameForDisplay(filter.getName()));
        //presentation.setEnabled(dataset.getConnectionHandler().isConnected());
        //e.getPresentation().setText(filter.getName());
    }
View Full Code Here

        }.start();
    }

    public void update(AnActionEvent e) {
        SourceCodeFile virtualFile = getSourcecodeFile(e);
        Presentation presentation = e.getPresentation();
        if (virtualFile == null) {
            presentation.setEnabled(false);
        } else {
            String text =
                    virtualFile.getContentType() == DBContentType.CODE_SPEC ? "Save spec" :
                            virtualFile.getContentType() == DBContentType.CODE_BODY ? "Save body" : "Save";

            DBSchemaObject object = virtualFile.getObject();
            presentation.setEnabled(object != null && !object.getStatus().is(DBObjectStatus.SAVING) && virtualFile.isModified());
            presentation.setText(text);
        }
    }
View Full Code Here

        }
    }

    public void update(AnActionEvent e) {
        SourceCodeFile virtualFile = getSourcecodeFile(e);
        Presentation presentation = e.getPresentation();
        if (virtualFile == null) {
            presentation.setEnabled(false);
        } else {
            String text =
                virtualFile.getContentType() == DBContentType.CODE_SPEC ? "Reload spec" :
                virtualFile.getContentType() == DBContentType.CODE_BODY ? "Reload body" : "Reload";

            presentation.setText(text);
            presentation.setEnabled(!virtualFile.isModified());
        }
    }
View Full Code Here

        }
        return actionGroup;
    }

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

        DBSchema schema = browserComponent.getSettings().getSchema();
        if (schema != null) {
            text = NamingUtil.enhanceUnderscoresForDisplay(schema.getName());
            icon = schema.getIcon();
        }

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

            datasetEditor.loadData(LOAD_INSTRUCTIONS);
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        presentation.setText("Reload");
        DatasetEditor datasetEditor = getDatasetEditor(e);

        boolean enabled =
                datasetEditor != null &&
                datasetEditor.getEditorTable() != null &&
                !datasetEditor.isInserting() &&
                !datasetEditor.isLoading();
        presentation.setEnabled(enabled);

    }
View Full Code Here

    }

    public void update(AnActionEvent e) {
        DatasetEditor datasetEditor = getDatasetEditor(e);

        Presentation presentation = e.getPresentation();
        presentation.setText("Column Setup...");

        boolean enabled =
                datasetEditor != null &&
                datasetEditor.getEditorTable() != null &&
                !datasetEditor.isInserting() &&
                !datasetEditor.isLoading();
        presentation.setEnabled(enabled);
    }
View Full Code Here

    }

    public void update(AnActionEvent e) {
        DatasetEditor datasetEditor = getDatasetEditor(e);

        Presentation presentation = e.getPresentation();
        presentation.setText("Sorting...");

        boolean enabled =
                datasetEditor != null &&
                datasetEditor.getEditorTable() != null &&
                !datasetEditor.isInserting() &&
                !datasetEditor.isLoading();
        presentation.setEnabled(enabled);
    }
View Full Code Here

            executionManager.showExecutionHistoryDialog(true);
        }
    }

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();
        Project project = ActionUtil.getProject(e);
        presentation.setEnabled(project != null);
        presentation.setIcon(Icons.METHOD_EXECUTION_HISTORY);
    }
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.