Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

SWT Layer details for contributors

jpeterka edited this page Aug 10, 2012 · 6 revisions

Basic guidelines for implementation SWT widgets on SWT Layer

General instructions

  • always try to make it user-friendly and readable for a client and other commiters
  • don't overengineer - make it simple and simply maintainable, use generic reasonably
  • make tests (see plugin org.jboss.reddeer.swt.tests)
  • try to make your methods safe and reliable for any situation (widgets created statically, dynamically, latency, etc.)

Widget API (interfaces) in org.jboss.reddeer.swt.api

  • is ment for widget control and state read only
  • don't add any getters related to other control if not necessary
  • Widgets api should contain most simple and effective method for manipulation and getters related to object properties
  • try to follow SWT method naming convention
  • don't extend interfaces if not necessary to be able keep specific javadoc

Widget implementation guidelines

  • You can create your own implementation or wrap SWTBot wdiget
  • Constructors are ment to locate and prepare widgets for additional manipulation or properties read
  • Widget implementation always extends Widget Abstract class
  • If possible implement Default implementation (DefaultShell, ...)
  • Widget implementations are ment to represent particular Widget Situation, not a Matchers
    • CORRECT impl.: WorkbenchShell, DefaultShell, etc.
    • INCORRECT impl.: RegexShell, ShellByTitle
  • For widgets using various matchers create specific constructors
    • Constructors that should be implemented:
    • DefaultWidget(), DefaultWidget(String title), DefaultWidget(Regex regex), DefaultWidget(Matchers... matchers), etc.

Matchers (TBD)

Conditions (TBD)

Exceptions and Error Handling (TBD)

Clone this wiki locally