Package hidb2.gui

Examples of hidb2.gui.ApplicationActionBarAdvisor


   */
  private AttributTableViewer createTabAttrSection(ScrolledForm managedForm, String sectionTitle,
      SelectionListener AddAfterCb, SelectionListener AddBeforeCb, SelectionListener DelCb, SelectionListener UpCb,
      SelectionListener DownCb)
    {
    final AttributTableViewer tabv;

    Composite body = managedForm.getForm().getBody();
    body.setLayout(FormLayoutFactory.createFormTableWrapLayout(true, 1));

    Composite left = toolkit.createComposite(body);
    left.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    left.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));

    Section section = Parts.createStaticSection(toolkit, left, sectionTitle);

    Composite container = toolkit.createComposite(section, SWT.NONE);
    container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 2));
    TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    container.setLayoutData(data);

    tabv = new AttributTableViewer(container);

    tabv.addModifyListener(new ModifyListener()
      {
        @Override
        public void modifyText(ModifyEvent e)
          {
          setDirty(true);
          }
      });

    Composite containerBtn = toolkit.createComposite(container, SWT.NONE);
    containerBtn.setLayout(FormLayoutFactory.createClearGridLayout(true, 1));

    /*Button btnAddAfter =*/toolkit.createGridButton(containerBtn, "Add After", AddAfterCb);

    /*Button btnAddBefore =*/toolkit.createGridButton(containerBtn, "Add Before", AddBeforeCb);

    /*Button btnRem =*/toolkit.createGridButton(containerBtn, "Delete", DelCb);

    // Add "up" and "down" for display order management.
    /*Button btnUp =*/toolkit.createGridButton(containerBtn, "Up", UpCb);

    /*Button btnDown =*/toolkit.createGridButton(containerBtn, "Down", DownCb);

    tabv.createMMI(new ITableLabelProvider()
      {
        public Image getColumnImage(Object element, int columnIndex)
          {
          Attribut attr = (Attribut) element;

          if (columnIndex == 0)
            {
            if (attr.getDisplayOrder() == getFD().getIconAttrIndex())
              {
              return RscMan.getImage(RscMan.IN_BOSS);
              }
            else
              {
              if (attr.getDisplayOrder() == getFD().getLabelAttrIndex())
                {
                return RscMan.getImage(RscMan.IN_GREENBOOKMARK);
                }
              }
            }

          return null;
          }

        public String getColumnText(Object element, int columnIndex)
          {
          return tabv.getLstAttr().get(columnIndex).format(element);
          }

        public void addListener(ILabelProviderListener listener)
          {
          }
View Full Code Here


   */
  private AttributTableViewer createTabAttrSection(ScrolledForm managedForm, HIDB2Toolkit toolkit, String sectionTitle,
      SelectionListener AddAfterCb, SelectionListener AddBeforeCb, SelectionListener DelCb, SelectionListener UpCb,
      SelectionListener DownCb)
    {
    final AttributTableViewer tabv;

    Composite body = managedForm.getForm().getBody();
    body.setLayout(FormLayoutFactory.createFormTableWrapLayout(true, 1));

    Composite left = toolkit.createComposite(body);
    left.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    left.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));

    Section section = Parts.createStaticSection(toolkit, left, sectionTitle);

    Composite container = toolkit.createComposite(section, SWT.NONE);
    container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 2));
    TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    container.setLayoutData(data);

    tabv = new AttributTableViewer(container);

    tabv.addModifyListener(new ModifyListener()
      {
        @Override
        public void modifyText(ModifyEvent e)
          {
          setDirty(true);
          }
      });

    Composite containerBtn = toolkit.createComposite(container, SWT.NONE);
    containerBtn.setLayout(FormLayoutFactory.createClearGridLayout(true, 1));

    /*Button btnAddAfter =*/ toolkit.createGridButton(containerBtn, "Add After", AddAfterCb);

    /*Button btnAddBefore =*/ toolkit.createGridButton(containerBtn, "Add Before", AddBeforeCb);

    /*Button btnRem =*/ toolkit.createGridButton(containerBtn, "Delete", DelCb);

    // Add "up" and "down" for display order management.
    /*Button btnUp =*/ toolkit.createGridButton(containerBtn, "Up", UpCb);

    /*Button btnDown =*/ toolkit.createGridButton(containerBtn, "Down", DownCb);

    tabv.createMMI(new ITableLabelProvider()
      {
        public Image getColumnImage(Object element, int columnIndex)
          {
          Attribut attr = (Attribut) element;

          if (columnIndex == 0)
            {
            if (attr.getDisplayOrder() == getFD().getIconAttrIndex())
              {
              return RscMan.getImage(RscMan.IN_BOSS);
              }
            else
              {
              if (attr.getDisplayOrder() == getFD().getLabelAttrIndex())
                {
                return RscMan.getImage(RscMan.IN_GREENBOOKMARK);
                }
              }
            }

          return null;
          }

        public String getColumnText(Object element, int columnIndex)
          {
          return tabv.getLstAttr().get(columnIndex).format(element);
          }

        public void addListener(ILabelProviderListener listener)
          {
          }
View Full Code Here

        // Implement image view  
        IWorkbenchWindow wbwin = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

        IPreferenceStore pref = Activator.getDefault().getPreferenceStore();

        DlgImageViewer div = new DlgImageViewer(wbwin.getShell());

        div.setPref(pref.getInt(PrefConst.P_IVR_MIN_ZOOM), pref.getInt(PrefConst.P_IVR_MAX_ZOOM), pref
            .getInt(PrefConst.P_IVR_DEFAULT_WIDTH), pref.getInt(PrefConst.P_IVR_DEFAULT_HEIGHT));

        div.open(lstSel.get(0).getAbsolutePath());
        }
      }
    }
View Full Code Here

      List<Card> lstCard = f.getLstCard();

      List<File> lstFic = new ArrayList<File>(lstCard.size());

      DlgImageViewer div = new DlgImageViewer(parent);

      IPreferenceStore pref = Activator.getDefault().getPreferenceStore();

      div.setPref(pref.getInt(PrefConst.P_IVR_MIN_ZOOM), pref.getInt(PrefConst.P_IVR_MAX_ZOOM), pref
          .getInt(PrefConst.P_IVR_DEFAULT_WIDTH), pref.getInt(PrefConst.P_IVR_DEFAULT_HEIGHT));

      for (Card crd : lstCard)
        {
        AttrImage imgAttr = (AttrImage) crd.getValue(attrIdx);
        if (imgAttr != null)
          {
          File imgFile = new File(imgAttr.getAbsolutePath());

          if (imgFile.exists())
            {
            lstFic.add(imgFile);
            }
          else
            {
            log.warning("File [" + imgAttr.getAbsolutePath() + "] not found");
            }
          }
        }

      div.open(lstFic);
      }
    }
View Full Code Here

    Section section = Parts.createStaticSection(fde.toolkit, left, title);
    Composite container = Parts.createStaticSectionClient(fde.toolkit, section);

    IActionBars actionBars = fde.getEditorSite().getActionBars();

    _fDescrColCount = new FormEntry(container, fde.toolkit, "Column Count", null, false);
    _fDescrColCount.setFormEntryListener(new FormEntryAdapter(fde, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          _adLayout.setColumnCount(Integer.parseInt(entry.getValue()));
          }
      });

    _fDescrColCount.setEditable(fde.isEditable());

    _fDescrImgIdx = new FormEntry(container, fde.toolkit, "Image Index", null, false);
    _fDescrImgIdx.setFormEntryListener(new FormEntryAdapter(fde, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          _adLayout.setImageIdx(Integer.parseInt(entry.getValue()));
View Full Code Here

  private AttributTableViewer _tabvCdAttr;

  private void createNameEntry(Composite client, IActionBars actionBars)
    {
    _fNameEntry = new FormEntry(client, toolkit, "Name", null, false);
    _fNameEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          getFD().setName(entry.getValue());
View Full Code Here

    _fNameEntry.setEditable(isEditable());
    }

  private void createCmtEntry(Composite client, IActionBars actionBars)
    {
    _fCmtEntry = new FormEntry(client, toolkit, "Comment", null, false);
    _fCmtEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          getFD().setComment(entry.getValue());
View Full Code Here

    _fCmtEntry.setEditable(isEditable());
    }

  private void createLabelIdxEntry(Composite client, IActionBars actionBars)
    {
    _fIdxLabelEntry = new FormEntry(client, toolkit, "Label Index", null, false);
    _fIdxLabelEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          getFD().setLabelAttrIndex(Integer.parseInt(entry.getValue()));
View Full Code Here

    _fIdxLabelEntry.setEditable(isEditable());
    }

  private void createIconIdxEntry(Composite client, IActionBars actionBars)
    {
    _fIdxIconEntry = new FormEntry(client, toolkit, "Icon Index", null, false);
    _fIdxIconEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars)
      {
        public void textValueChanged(FormEntry entry)
          {
          getFD().setIconAttrIndex(Integer.parseInt(entry.getValue()));
View Full Code Here

    right.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));

    Section sectionR = Parts.createStaticSection(toolkit, right, "Informations");
    Composite cnt2 = Parts.createStaticSectionClient(toolkit, sectionR);

    _fMainTable = new FormEntry(cnt2, toolkit, "Main Table", SWT.SINGLE);
    _fMainTable.setEditable(false);

    _fCardTable = new FormEntry(cnt2, toolkit, "Card Table", SWT.SINGLE);
    _fCardTable.setEditable(false);

    _fNbInstance = new FormEntry(cnt2, toolkit, "Instance Count", SWT.SINGLE);
    _fNbInstance.setEditable(false);

    sectionR.setClient(cnt2);
    }
View Full Code Here

TOP

Related Classes of hidb2.gui.ApplicationActionBarAdvisor

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.