Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2011 JBoss Inc
   * 
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
   * use this file except in compliance with the License. You may obtain a copy of
   * the License at
   * 
   * http://www.apache.org/licenses/LICENSE-2.0
   * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
  */
 
 package org.guvnor.inbox.client.editor;
 
 
Widget with a table of inbox
 
 public class InboxEditor
         extends Composite {
 
     // UI
     interface InboxPagedTableBinder
             extends
             UiBinder<WidgetInboxEditor> {
     }
 
     @UiField()
     protected Button deleteSelectedButton;
 
     @UiField()
     protected Button refreshButton;
 
     @UiField()
     protected Button openSelectedButton;
 
     @UiField(provided = true)
 
     private static InboxPagedTableBinder uiBinder = GWT.create(InboxPagedTableBinder.class);
 
 
     //private Caller<M2RepoService> m2RepoService;
 
 
     public InboxEditor(Caller<InboxServiceinboxService) {
         this(inboxServicenull);
 
     }
 
     public InboxEditor(Caller<InboxServiceinboxServicefinal String inboxName) {
         //this.m2RepoService = repoService;
          = new InboxPagedTable(inboxServiceinboxName);
 
 
         Column<InboxPageRowStringopenColumn = new Column<InboxPageRowString>(new ButtonCell()) {
             public String getValue(InboxPageRow row) {
                 return "Open";
             }
         };
 
         openColumn.setFieldUpdater(new FieldUpdater<InboxPageRowString>() {
             public void update(int index,
                                InboxPageRow row,
                                String value) {
 /*                Window.open(getFileDownloadURL(row.getPath()),
                         "downloading",
                         "resizable=no,scrollbars=yes,status=no");*/
             }
         });
 
         .addColumn(openColumnnew TextHeader("Open"));
 
         initWidget(.createAndBindUi(this));
     }
 
 
    @UiHandler("deleteSelectedButton")
    void deleteSelected(ClickEvent e) {
/*        if (getSelectedJars() == null) {
            Window.alert("Please Select A Jar To Delete");
            return;
        }
        if (!Window.confirm("AreYouSureYouWantToDeleteTheseItems")) {
            return;
        }
        m2RepoService.call(new RemoteCallback<Void>() {
            @Override
            public void callback(Void v) {
                Window.alert("Deleted successfully");
                pagedJarTable.refresh();
            }
        }).deleteJar(getSelectedJars());*/
    }
    public String[] getSelected() {
/*        Set<InboxPageRow> selectedRows = selectionModel.getSelectedSet();
        // Compatibility with existing API
        if (selectedRows.size() == 0) {
            return null;
        }
        // Create the array of paths
        String[] paths = new String[selectedRows.size()];
        int rowCount = 0;
        for (InboxPageRow row : selectedRows) {
            paths[rowCount++] = row.getPath();
        }
        return paths;*/
        return null;
    }
    @UiHandler("refreshButton")
    void refresh(ClickEvent e) {
        .refresh();
    }
    @UiHandler("openSelectedButton")
    void openSelected(ClickEvent e) {
    }
New to GrepCode? Check out our FAQ X