jboss-reddeer/reddeer — pull request #791 by jpeterka (2014-10-22 10:17:45+00:00)
Title: View methods should expect the same prerequisites

Currently many if not most of different view implementation methods calls open which is comfortable for user but ignores unexpected view closing and similar scenarios.

Goal is to find appropriate balance between detailed test control and user comfort

Suggestion1: Open is required, activate() is called by default
Pros: User knows when he don't have opened view
Cons: User must open view explicitly, user don't know if view was activated or not (isActive() can be implemented)

Suggestion2: Nothing is required, view methods are able to perform any method without any prerequisites (most views are implemented this way today)
Pros: User can call any method directly
Cost: User don't know if view was opened/acitavted (solution is to to implement isOpen() & isActive() method)

Suggestion3: Nothing is expected, view must be opened or activated (if it's open)
Pros: User has complete control over the state
Cost: Not comfortable, client must all open and activate all the time

UPDATE1: Suggestion 4 added
Suggestion 4 (slightly modified suggestion 1): open() is called in constructor but (re)opening is not assured by methods, just an activation

We should have an agreement and follow one of these approaches through all view and rest of RedDeer API. RedDeer was meant to take care of this burden from client:

Mostly client doesn't care about state (open/closed,activate/non-activate) of view and want to call particular action like:
```java
ProblemsView v = new ProblemsView();
list = ProblemsView.getAllErrrors();

Outline view v2 = new OutlineView();
v2.hideFields();
elements = v2.outlineElements();
```
For such special cases when user want's to know the state he could use methods like isActivate(), isOpen();

This discussion is open and we should have common consensus in this before RedDeer 1.0 . Note that RedDeer goal was to simplify and avoid unnecessary calls/prerequisites for general cases. Please share you ideas/votes/comments: