Package com.onpositive.commons.elements

Examples of com.onpositive.commons.elements.SWTEventListener


    c1.add(current);
    c1.add(l);

    ButtonSelector add = new ButtonSelector();
    add.addListener(SWT.Selection, new SWTEventListener() {

      public void handleEvent(AbstractUIElement element, Event event) {
        currNSBinding.setName("Current Namespace");
        currNSBinding.setDescription("Add New Namespace");
        currNSBinding.setValue("", null);
        CompositeEditor ce = new CompositeEditor(currNSBinding) {

          protected void update(AbstractUIElement<?> container) {
            super.update(container);
            getControl().pack(true);
          }
        };

        OneLineTextElement<String> f = new OneLineTextElement(
            currNSBinding);
        ce.setLayout(new FillLayout());
        ce.add(f);

        TitledDialog td = new TitledDialog(ce) {

          protected void okPressed() {
            currNSBinding.commit();
            super.okPressed();
          }

          public int open() {
            int ch = super.open();
            return ch;
          }
        };
        td.create();
        td.getShell().setSize(300, 190);
        td.open();

        String curr = (String) currNSBinding.getValue();

        if (!l.getRealm().contains(curr)) {// curr.length() != 0) {
          l.addValue(curr);
        }
        return;
      }

    });
    add.setText("add");
    add.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));

    ButtonSelector remove = new ButtonSelector();
    remove.addListener(SWT.Selection, new SWTEventListener() {

      public void handleEvent(AbstractUIElement element, Event event) {
        IStructuredSelection s = l.getSelection();
        StructuredSelection ss = (StructuredSelection) s;
        String selected = (String) ss.getFirstElement();
View Full Code Here


  private static void addIsNullButtonSelector(final IBinding bnd,
      Container editor, String rId) {
    ButtonSelector bs = new ButtonSelector(SWT.CHECK);
    bs.setText("is null");
    bs.addListener(SWT.Selection, new SWTEventListener() {

      public void handleEvent(AbstractUIElement element, Event event) {
        Binding b = (Binding) bnd;
        boolean readOnly = b.isReadOnly();
        b.setReadOnly(!readOnly);
View Full Code Here

      return;
    }

    ButtonSelector bsNotIndexable = new ButtonSelector(SWT.CHECK);
    bsNotIndexable.setText("not indexed");
    bsNotIndexable.addListener(SWT.Selection, new SWTEventListener() {

      public void handleEvent(AbstractUIElement element, Event event) {
        Binding b = (Binding) bnd;
        if (b instanceof EditingBinding) {
          boolean flg = ((EditingBinding) b).isNotIndexable();
View Full Code Here

TOP

Related Classes of com.onpositive.commons.elements.SWTEventListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.