Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364449 - Configuring Fields invisible on certain Devices
Summary: Configuring Fields invisible on certain Devices
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Stephan Leicht Vogt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 04:57 EST by Ralph Steiner CLA
Modified: 2021-08-19 11:04 EDT (History)
3 users (show)

See Also:
zimmermann: juno+


Attachments
Suggested Patch on AbstractForm/IFormField (3.13 KB, patch)
2011-11-22 04:57 EST, Ralph Steiner CLA
no flags Details | Diff
Example patch how UI could test on minimum size (1.80 KB, patch)
2011-11-22 04:58 EST, Ralph Steiner CLA
no flags Details | Diff
Modified Suggested Patch on AbstractForm/IFormField (3.42 KB, patch)
2012-01-12 09:03 EST, Ralph Steiner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Steiner CLA 2011-11-22 04:57:14 EST
Created attachment 207349 [details]
Suggested Patch on AbstractForm/IFormField

On formfields one needs an easy way to configure them invisible for certain environments. For example, a 'detail' groupbox should not be visible on iPhones.
I suggest here something like 'int getConfiguredMinimumSizeForVisibility()'.
UI's can then now access this information and render fields invisible, depending on the environment.
Comment 1 Ralph Steiner CLA 2011-11-22 04:58:49 EST
Created attachment 207350 [details]
Example patch how UI could test on minimum size
Comment 2 Stephan Leicht Vogt CLA 2011-11-30 02:33:17 EST
Suggested Patch is ok save for one issue. Please use getter/setter for the minimumSizeForVisibility like the other properties. And next time you create a patch-file: please activate the bullet "Workspace" in the "Patch-Root" Box.
Comment 3 Ralph Steiner CLA 2012-01-12 09:03:53 EST
Created attachment 209378 [details]
Modified Suggested Patch on AbstractForm/IFormField

Added the setters to the patch.
Comment 4 Claudio Guglielmo CLA 2012-04-25 10:06:34 EDT
Fixed by introducing UserAgent, UserAgentUtility, IUiDeviceType and IUiLayer.

The UserAgent holds information about the kind of user interface used on the client side. With this information it's easy to make a field invisible. To make it even more easy one can use the UserAgentUtility.

Example:

@Override
protected void execInitField() throws ProcessingException {
  if (UserAgentUtility.isMobileDevice()) {
    setVisibleGranted(false);
  }
}

The UserAgent is stored on the client as well as on the server session. This even allows to access the ui data on the server. The SessionView already takes advantage of this feature and displays the UserAgent as separate column (http://localhost:8080/#project#/process?actionId=tab.SessionsView). 

Btw: This gives more flexibility than the proposed solution, thats why it has been preferred.

MIGRATION:
If you would like to use this feature with the swing ui you need to make a little adjustment in your SwingApplication. When creating a new session just add the UserAgent as second parameter and your fine.

@Override
protected IClientSession getClientSession() {
  return SERVICES.getService(IClientSessionRegistryService.class).newClientSession(ClientSession.class, initUserAgent());
}

If you are using the other ui layers (rap or swt) you don't have to do anything.
Comment 5 Matthias Zimmermann CLA 2012-05-23 10:49:51 EDT
Comment on attachment 209378 [details]
Modified Suggested Patch on AbstractForm/IFormField

added iplog flag
Comment 6 Claudio Guglielmo CLA 2012-05-23 11:04:42 EDT
Comment on attachment 209378 [details]
Modified Suggested Patch on AbstractForm/IFormField

Removed iplog flag because patch has not been used.
Comment 7 Ivan Motsch CLA 2012-05-24 10:01:49 EDT
verified
Comment 8 Matthias Zimmermann CLA 2012-07-09 06:49:47 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)