Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IStructuredSelection.toArray()


                return;
            }

            IStructuredSelection structured = (IStructuredSelection) event.getSelection();

            Object[] elements = structured.toArray();
            for( Object element : elements ) {
                boolean state = tableViewer.getChecked(element);
                tableViewer.setChecked(element, !state);
            }
        }
View Full Code Here


  }

  private void edit() {
    IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();

    Object[] objects= selection.toArray();
    if ((objects == null) || (objects.length != 1))
      return;

    TemplatePersistenceData data= (TemplatePersistenceData) selection.getFirstElement();
    edit(data);
View Full Code Here

    }
  }

  private void export() {
    IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
    Object[] templates= selection.toArray();

    TemplatePersistenceData[] datas= new TemplatePersistenceData[templates.length];
    for (int i= 0; i != templates.length; i++)
      datas[i]= (TemplatePersistenceData) templates[i];
View Full Code Here

     */
    private void handleRemove() {
        ISelection selection = selectedTargets.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = (IStructuredSelection) selection;
            Object[] selected = structuredSelection.toArray();
            for (int i = 0; i < selected.length; i++) {
                targets.remove(selected[i]);
                monitor.modifySelection(selected[i], false);
                TargetSelectionEvent event =
                        new TargetSelectionEvent(this, selected[i], false);
View Full Code Here

        Action deleteAction = new Action() {
            public void run() {
                IStructuredSelection selection =
                        (IStructuredSelection) viewer.getSelection();

                Object[] selectedObjects = selection.toArray();
                BeanProxy theme = (BeanProxy) context.getInteractionModel();
                ListProxy variants = (ListProxy)
                        theme.getPropertyProxy(PolicyModel.VARIANTS);
                for (int i = 0; i < selectedObjects.length; i++) {
                    variants.removeItemProxy((Proxy) selectedObjects[i]);
View Full Code Here

        Action copyAction = new Action() {
            public void run() {
                Clipboard clipboard = new Clipboard(widget.getDisplay());
                VariantTransfer transfer = VariantTransfer.getInstance();
                IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
                Object[] selectionArray = selection.toArray();
                VariantBuilder[] modelArray = new VariantBuilder[selectionArray.length];
                for (int i = 0; i < selectionArray.length; i++) {
                    modelArray[i] = (VariantBuilder) ((Proxy) selectionArray[i]).getModelObject();
                }
                clipboard.setContents(new Object[]{modelArray},
View Full Code Here

    private void createActions() {
        deleteAction = new Action() {
            public void run() {
                IStructuredSelection selection = (IStructuredSelection) targetViewer.getSelection();
                Object[] selected = selection.toArray();
                for (int i = 0; i < selected.length; i++) {
                    targets.remove(selected[i]);
                }
                targetViewer.refresh();
                setPolicyTargets();
View Full Code Here

    Object source = e.getSource();
    if (source == fClearButton) {
      folders.clear();
    } else if (source == fRemoveButton) {
      IStructuredSelection selection = (IStructuredSelection) fLocationsViewer.getSelection();
      Object[] array = selection.toArray();
      for (int i = 0; i < array.length; i++) {
        if (array[i] instanceof RutaPageFolder) {
          for (Iterator iterator = folders.iterator(); iterator.hasNext();) {
            RutaPageFolder f = (RutaPageFolder) iterator.next();
            if (f == array[i]) {
View Full Code Here

        public void widgetSelected(SelectionEvent e) {
          ISelection s = fList.getSelection();
          if (s instanceof IStructuredSelection) {
            IStructuredSelection sel = (IStructuredSelection) s;
            fList.remove(sel.toArray());
            save();
          }
        }
      });
      return comp;
View Full Code Here

    thread.setDaemon(true);
    thread.start();
    dlg.open();
    if (dlg.selection != null) {
      IStructuredSelection s = dlg.selection;
      Object[] ar = s.toArray();
      String[] result = new String[ar.length];
      for (int a = 0; a < ar.length; a++) {
        result[a] = ((Field) ar[a]).name;
      }
      return result;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.