Skip to content

Dynamically created tabs are shown on explain and profile queries #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 19, 2017

Conversation

Metaur
Copy link
Contributor

@Metaur Metaur commented Jan 16, 2017

No description provided.

@Metaur Metaur force-pushed the query-plan-tree-table branch from f00bc64 to 528da71 Compare January 16, 2017 16:27
Copy link
Contributor

@FylmTM FylmTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check my comments

@@ -119,6 +146,38 @@ private void createUIComponents() {
graphCanvas = new JPanel(new GridLayout(0, 1));
consoleTabsPane = new JBTabsPaneImpl(null, SwingConstants.TOP, this);
consoleTabs = (JBTabsImpl) consoleTabsPane.getTabs();

consoleTabs.addTabMouseListener(new MouseListener() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be MouseAdaptor somewhere, that can be used to override only necessary methods.

final TabInfo info = consoleTabs.findInfo(e);
if (info != null) {
String tabTitle = info.getText();
if (tabTitle.startsWith("Profile") || tabTitle.startsWith("Explain")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are making comparisons using strings, then we should put them in constants and reuse constants

});
tabInfo.setTabLabelActions(tabActions, ActionPlaces.EDITOR_TAB);

String planType = result.hasProfile() ? "Profile" : "Explain";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants!


boolean hasProfile();

GraphQueryPlan getPlan();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand "hasPlan()" is main method. And it is accompanied with "getPlan()"

In this case "hasProfile" is misleading. I would prefer it be called "isProfilePlan()" to clearly define that it actually specifies type of plan.

.orElse(false);
}

public GraphQueryPlan getQueryPlan() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to use Optional here.

@Metaur Metaur force-pushed the query-plan-tree-table branch from f2f3075 to 8359c4a Compare January 17, 2017 13:25
@FylmTM FylmTM merged commit 1f903e2 into master Jan 19, 2017
@FylmTM FylmTM deleted the query-plan-tree-table branch January 19, 2017 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants