/** * Returns a copy of the given RowData * * @param data * RowData to copy * @return a copy of the argument */ public static RowData copyData(RowData data) { RowData newData = new RowData(data.width, data.height); newData.exclude = data.exclude; return newData; }
protected RowData createRowData( int width, int height, boolean visible ) { RowData data = new RowData( width, height ); data.exclude = !visible; return data; }
RowData getRowData(int newSide) { RowData rowData = new RowData(); if ((newSide == BOTTOM) || (newSide == TOP)) { rowData.width = 400; } return rowData; }
button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // add new row to Adapter adapter.addRow(new RowData("0:00")); } });
/** * Returns a copy of the given RowData * * @param data * RowData to copy * @return a copy of the argument */ public static RowData copyData(RowData data) { RowData newData = new RowData(data.width, data.height); newData.exclude = data.exclude; return newData; }
/** * Returns a copy of the given RowData * * @param data * RowData to copy * @return a copy of the argument */ public static RowData copyData(RowData data) { RowData newData = new RowData(data.width, data.height); newData.exclude = data.exclude; return newData; }
RowData [] rows = new RowData [listSize]; for (int i = 0; i < listSize; i++) { rows[i] = new RowData(new String [] {col0List.get(i), col1list.get(i), ...}); }
RowData data = new RowData(); control.setLayoutData(data);
private void addExcludedRowData( Composite facade ) { RowData rowData = new RowData(); rowData.exclude = true; facade.setLayoutData( rowData ); }
// Activity-level variable scope private List<RowData> items = new ArrayList<RowData>(); private RowdataAdapter adapter; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); listView1 = (ListView)findViewById(R.id.listView1); // adding first item to List, it's optional step items.add(new RowData("0:00")); adapter = new RowdataAdapter(this, R.layout.listview_item_row, items); listView1.setAdapter(adapter); }
/** * Creates a new RowDataFactory initialized with the SWT defaults. * * <p> * Initial values are: * </p> * * <ul> * <li>exclude(false)</li> * <li>hint(SWT.DEFAULT, SWT.DEFAULT)</li> * </ul> * * @return a new GridDataFactory instance */ public static RowDataFactory swtDefaults() { return new RowDataFactory(new RowData()); }
/** * Creates a new RowDataFactory initialized with the SWT defaults. * * <p> * Initial values are: * </p> * * <ul> * <li>exclude(false)</li> * <li>hint(SWT.DEFAULT, SWT.DEFAULT)</li> * </ul> * * @return a new GridDataFactory instance */ public static RowDataFactory swtDefaults() { return new RowDataFactory(new RowData()); }
/** * Creates a new RowDataFactory initialized with the SWT defaults. * * <p> * Initial values are: * </p> * * <ul> * <li>exclude(false)</li> * <li>hint(SWT.DEFAULT, SWT.DEFAULT)</li> * </ul> * * @return a new GridDataFactory instance */ public static RowDataFactory swtDefaults() { return new RowDataFactory(new RowData()); }
public static Button createAlertButton(final Composite panel, String localizationKey) { final Button button = new Button(panel, SWT.PUSH); button.setText(MessageText.getString(localizationKey)); final RowData rData = new RowData(); rData.width = Math.max( Utils.BUTTON_MINWIDTH, button.computeSize(SWT.DEFAULT, SWT.DEFAULT).x ); button.setLayoutData(rData); return button; }
Button button = null; for (int i = 0; i < 3; i++) { button = new Button(group, SWT.PUSH); button.setText("ABC" + i); } Label verticalSeparator = new Label(group, SWT.SEPARATOR | SWT.VERTICAL); RowData layoutData = new RowData(); layoutData.height = button.computeSize(SWT.DEFAULT, SWT.DEFAULT).y; verticalSeparator.setLayoutData(layoutData);
public void layoutWidget( Control control, String elementName, Map<String, String> attributes, Composite container, SwtMetawidget metawidget ) { // Do not layout space for empty stubs if ( control instanceof Stub && ( (Stub) control ).getChildren().length == 0 ) { RowData stubData = new RowData(); stubData.exclude = true; control.setLayoutData( stubData ); return; } // Do nothing }
/** * Sets the layout data for the children of the layout. */ @Override void setLayoutData () { Control [] children = layoutComposite.getChildren (); TableItem [] items = table.getItems (); RowData data; int width, height; String exclude; for (int i = 0; i < children.length; i++) { width = Integer.valueOf(items [i].getText (WIDTH_COL)).intValue (); height = Integer.valueOf(items [i].getText (HEIGHT_COL)).intValue (); data = new RowData (width, height); exclude = items [i].getText (EXCLUDE_COL); data.exclude = exclude.equals ("true"); children [i].setLayoutData (data); } }
/** Sets the layouData on the Control to a new GridData, and returns an API for modifying it. */ public static LayoutsRowData setRowData(Control control) { getLayout(control.getParent(), RowLayout.class); RowData rowData = new RowData(); control.setLayoutData(rowData); return new LayoutsRowData(rowData); }
private void addPageLink(Composite container, FormToolkit toolkit, String text, String id, String imgRef, IHyperlinkListener listener) { String cid = helpPart.getCurrentPageId(); if (cid!=null && cid.equals(id)) return; ImageHyperlink link = new ImageHyperlink(container, SWT.WRAP|toolkit.getOrientation()); toolkit.adapt(link, true, true); link.setImage(HelpUIResources.getImage(imgRef)); link.setText(text); link.setHref(id); link.setBackground(null); link.addHyperlinkListener(listener); hyperlinkGroup.add(link); RowData data = new RowData(); data.exclude = false; link.setLayoutData(data); }
public static Object create(ActionContext actionContext){ Thing self = (Thing) actionContext.get("self"); int width = self.getInt("width", -1); if(width == -1) width = SWT.DEFAULT; int height = self.getInt("height", -1); if(height == -1) height = SWT.DEFAULT; RowData data = new RowData(UtilSwt.getInt(width), UtilSwt.getInt(height)); if(self.getBoolean("exclude")) data.exclude = true; Control parent = (Control) actionContext.get("parent"); parent.setLayoutData(data); actionContext.getScope(0).put(self.getString("name"), data); return data; }