Skip to content
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

Added procedure and function grouping in metadata view. #78

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sergejskovtuns
Copy link
Contributor

No description provided.

import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.MutableTreeNodeProducers;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.Root;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.metadata.tree.TreeNodeDirectory;
import com.neueda.jetbrains.plugin.graphdb.jetbrains.ui.datasource.tree.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use imports with '*'. Use only imports what you need

public Directory getDirectory(String name) {
return directories.computeIfAbsent(
name,
(k) -> new Directory(k, directoryProducer, functionProducer)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is 'k'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'k' stands for key, however I changed it to 'newName' for more understanding


class Leaf implements TreeNode {
private final String name;
private Function<TreeNode, DefaultMutableTreeNode> mutableTreeNodeProducer;
Copy link
Contributor

Choose a reason for hiding this comment

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

mutableTreeNodeProducer should be final

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

);
}

private MutableTreeNodeProducers() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Constructor should be in the top of the class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

public Directory getDirectory(String name) {
return directories.computeIfAbsent(
name,
(k) -> new Directory(k, directoryProducer, functionProducer)
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't understand what is 'k'. Please use full names for the variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

'k' stands for key, however I changed it to 'newName' for more understanding


public interface TreeNode {

public String getName();
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public String getName();

public DefaultMutableTreeNode getMutableTreeNode();
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public interface TreeNodeDirectory extends TreeNode {

public void addLeaf(String name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


public void addLeaf(String name);

public TreeNodeDirectory getDirectory(String name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Access modifier is 'public' is redudant here. In interfaces access modifier by default is public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

- code style changed
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.

None yet

2 participants