private StatusItem getStatusItem(String name) { for (StatusItem item : statusStore.getAll()) { if (item.getName().equals(name)) { return item; } } return null; }
public void setClickedCoordinates(double x, double y) { StatusItem messageItemX = getStatusItem(CLICK_COORD_X); messageItemX.setValue(String.valueOf(x)); statusStore.update(messageItemX); StatusItem messageItemY = getStatusItem(CLICK_COORD_Y); messageItemY.setValue(String.valueOf(y)); statusStore.update(messageItemY); }
public void setCurrentCoordinate(LonLat currentCoordinate) { StatusItem lonItem = getStatusItem(LON_LABEL); lonItem.setValue(Double.toString(currentCoordinate.lon())); StatusItem latItem = getStatusItem(LAT_LABEL); latItem.setValue(Double.toString(currentCoordinate.lat())); statusStore.update(lonItem); statusStore.update(latItem); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; StatusItem other = (StatusItem) obj; if (!getOuterType().equals(other.getOuterType())) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; }
public SuggestionsSection(NodeParent parent, SuggestionsCategoryInfo info) { super(parent); mHeader = new SectionHeader(info.getTitle()); mCategoryInfo = info; mMoreButton = new ActionItem(info); mStatus = StatusItem.createNoSuggestionsItem(info); resetChildren(); }
public static TableColumnCore[] createIncompleteDM(String tableID, boolean big) { final String[] defaultVisibleOrder = { ColumnThumbAndName.COLUMN_ID, "azsubs.ui.column.subs", SizeItem.COLUMN_ID, ColumnProgressETA.COLUMN_ID, SeedsItem.COLUMN_ID, PeersItem.COLUMN_ID, }; TableColumnManager tcManager = TableColumnManager.getInstance(); Map<String, TableColumnCore> mapTCs = tcManager.getTableColumnsAsMap(DownloadTypeIncomplete.class, tableID); tcManager.setDefaultColumnNames(tableID, defaultVisibleOrder); if (!tcManager.loadTableColumnSettings(DownloadTypeIncomplete.class, tableID) || areNoneVisible(mapTCs)) { setVisibility(mapTCs, defaultVisibleOrder); ColumnThumbAndName tc = (ColumnThumbAndName) mapTCs.get(ColumnThumbAndName.COLUMN_ID); if (tc != null) { tcManager.setDefaultSortColumnName(tableID, ColumnThumbAndName.COLUMN_ID); tc.setSortAscending(true); } } // special changes StatusItem tcStatusItem = (StatusItem) mapTCs.get(StatusItem.COLUMN_ID); if (tcStatusItem != null) { tcStatusItem.setChangeRowFG(false); if (big) { tcStatusItem.setChangeCellFG(false); } } if (big) { ShareRatioItem tcShareRatioItem = (ShareRatioItem) mapTCs.get(ShareRatioItem.COLUMN_ID); if (tcShareRatioItem != null) { tcShareRatioItem.setChangeFG(false); tcShareRatioItem.setWidth(80); } } return mapTCs.values().toArray(new TableColumnCore[0]); }
@Override public long getItemId(int position) { StatusItem item = (StatusItem) getItem(position); return item.getStatus(); }
public void setScale(String scale) { StatusItem scaleItem = getStatusItem(SCALE_LABEL); scaleItem.setValue(scale); statusStore.update(scaleItem); }