/* * Smart GWT (GWT for SmartClient) * Copyright 2008 and beyond, Isomorphic Software, Inc. * * Smart GWT is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License version 3 * as published by the Free Software Foundation. Smart GWT is also * available under typical commercial license terms - see * http://smartclient.com/license * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ import com.smartgwt.client.types.Alignment; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.TextAreaItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.sample.showcase.client.data.CountrySampleData; import com.google.gwt.core.client.EntryPoint; public class SelectCellTextDragSample implements EntryPoint { public void onModuleLoad() { VLayout vLayout = new VLayout(); vLayout.setMembersMargin(10); vLayout.setWidth100(); vLayout.setHeight100(); ListGrid listGrid = new ListGrid(); listGrid.setWidth100(); listGrid.setHeight100(); listGrid.setAlternateRecordStyles(true); listGrid.setSelectionType(SelectionStyle.NONE); listGrid.setShowRollOver(false); listGrid.setCanDragSelectText(true); ListGridField countryName = new ListGridField("countryName", "Country"); countryName.setWidth(120); ListGridField background = new ListGridField("background", "Background"); ListGridField countryCode = new ListGridField("countryCode", "Flag"); countryCode.setAlign(Alignment.CENTER); countryCode.setWidth(50); countryCode.setType(ListGridFieldType.IMAGE); countryCode.setImageSize(24); countryCode.setImageURLPrefix("flags/24/"); countryCode.setImageURLSuffix(".png"); listGrid.setFields(countryName,background,countryCode); listGrid.setWrapCells(true); listGrid.setFixedRecordHeights(false); listGrid.setData(CountrySampleData.getNewRecords()); DynamicForm form = new DynamicForm(); form.setWidth100(); form.setHeight(150); TextAreaItem textAreaItem = new TextAreaItem("textAreaItem"); textAreaItem.setTitle("Pasted value"); textAreaItem.setWidth("100%"); textAreaItem.setHeight("100%"); form.setFields(textAreaItem); vLayout.addMember(listGrid); vLayout.addMember(form); vLayout.draw(); } }