Java 类com.google.gwt.user.client.ui.Label 实例源码
项目:empiria.player
文件:PageViewSocketImpl.java
@Override
public void setPageViewCarrier(PageViewCarrier pageViewCarrier) {
view.getTitlePanel().clear();
view.getTitlePanel().add(pageViewCarrier.getPageTitle());
if (pageViewCarrier.hasContent()) {
Panel contentPanel = new FlowPanel();
if (pageViewCarrier.pageType == PageType.ERROR) {
contentPanel.setStyleName(styleNames.QP_PAGE_ERROR());
Label errorLabel = new Label(pageViewCarrier.errorMessage);
errorLabel.setStyleName(styleNames.QP_PAGE_ERROR_TEXT());
contentPanel.add(errorLabel);
}
view.getItemsPanel().clear();
view.getItemsPanel().add(contentPanel);
}
}
项目:EasyML
文件:Leaf.java
/**
* Create a leaf node for the Tree
*
* @param name name of the TreeItem
* @param module Attached moduleId for the TreeItem
*/
public Leaf(String name,
T module,
String style) {
// add context menu
this.menu = new ContextMenu();
label = new Label(name);
this.setWidget(label);
label.addMouseDownHandler(new MouseDownHandler() {
@Override
public void onMouseDown(MouseDownEvent event) {
// display the context menu when right click
if (event.getNativeButton() == NativeEvent.BUTTON_RIGHT) {
menu.setPopupPosition(event.getClientX(), event.getClientY());
menu.show();
}
}
});
// set moduleId
this.module = module;
this.addStyleName("bda-treeleaf");
if (!style.equals(""))
this.addStyleName(style);
}
项目:EasyML
文件:ParameterPanel.java
protected void initGridHead(int size){
this.setSpacing(3);
paramsGrid = new Grid(size, 3);
paramsGrid.setStyleName("gridstyle");
paramsGrid.setBorderWidth(1);
paramsGrid.setWidth("250px");
Label nameLabel = new Label(Constants.studioUIMsg.parameter());
nameLabel.setWidth("65px");
paramsGrid.setWidget(0, 0, nameLabel);
Label typeLabel = new Label(Constants.studioUIMsg.type());
typeLabel.setWidth("40px");
paramsGrid.setWidget(0, 1, typeLabel);
Label valueLabel = new Label(Constants.studioUIMsg.value());
paramsGrid.setWidget(0, 2, valueLabel);
paramsGrid.setVisible(false);
}
项目:EasyML
文件:BaseWidget.java
public BaseWidget(String text, String id) {
this.label = new Label(text);
p.setWidget(new HTML(text));
p.getElement().getStyle().setZIndex(6);
this.id = id;
label.setStyleName("basewidget");
label.setTitle(text);
canvas = new GWTCanvas();
abspanel.add(label, 0, 0);
abspanel.add(canvas, 0, 0);
focusPanel.add(abspanel.asWidget());
focusPanel.setHeight("35px");
focusPanel.setFocus(true);
focusPanel.setStyleName("basefocuspanel");
abspanel.setHeight("100%");
initWidget(focusPanel);
addDomHandler(this, MouseDownEvent.getType());
addDomHandler(this, MouseUpEvent.getType());
addDomHandler(this, MouseOverEvent.getType());
addDomHandler(this, MouseOutEvent.getType());
}
项目:unitimes
文件:InstructorAttributesTable.java
protected Widget getCell(final AttributeInterface feature, final AttributesColumn column, final int idx) {
switch (column) {
case NAME:
return new Label(feature.getName() == null ? "" : feature.getName(), false);
case CODE:
return new Label(feature.getCode() == null ? "" : feature.getCode(), false);
case TYPE:
if (feature.getType() == null)
return null;
else {
Label type = new Label(feature.getType().getAbbreviation(), false);
type.setTitle(feature.getType().getLabel());
return type;
}
case PARENT:
return new Label(feature.getParentName() == null ? "" : feature.getParentName(), false);
case INSTRUCTORS:
if (feature.hasInstructors())
return new InstructorsCell(feature);
else
return null;
default:
return null;
}
}
项目:unitimes
文件:Client.java
public void initPageAsync(final String page) {
GWT.runAsync(new RunAsyncCallback() {
public void onSuccess() {
init(page);
LoadingWidget.getInstance().hide();
}
public void onFailure(Throwable reason) {
Label error = new Label(MESSAGES.failedToLoadPage(reason.getMessage()));
error.setStyleName("unitime-ErrorMessage");
RootPanel loading = RootPanel.get("UniTimeGWT:Loading");
if (loading != null) loading.setVisible(false);
RootPanel.get("UniTimeGWT:Body").add(error);
LoadingWidget.getInstance().hide();
UniTimeNotifications.error(MESSAGES.failedToLoadPage(reason.getMessage()), reason);
}
});
}
项目:appinventor-extensions
文件:GalleryPage.java
/**
* Helper method called by constructor to initialize the salvage section
* @param container The container that salvage label reside
*/
private void initSalvageSection(Panel container) { //TODO: Update the location of this button
if (!canSalvage()) { // Permitted to salvage?
return;
}
final Label salvagePrompt = new Label("salvage");
salvagePrompt.addStyleName("primary-link");
container.add(salvagePrompt);
salvagePrompt.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final OdeAsyncCallback<Void> callback = new OdeAsyncCallback<Void>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(Void bool) {
salvagePrompt.setText("done");
}
};
Ode.getInstance().getGalleryService().salvageGalleryApp(app.getGalleryAppId(), callback);
}
});
}
项目:unitimes
文件:UniTimeVersion.java
public UniTimeVersion() {
iLabel = new Label();
RPC.execute(new MenuInterface.VersionInfoRpcRequest(), new AsyncCallback<VersionInfoInterface>() {
@Override
public void onSuccess(VersionInfoInterface result) {
iLabel.setText(MESSAGES.pageVersion(result.getVersion(), result.getReleaseDate()));
}
@Override
public void onFailure(Throwable caught) {
}
});
initWidget(iLabel);
}
项目:unitimes
文件:RestrictionsTable.java
private void addConfig(Config config) {
List<Widget> line = new ArrayList<Widget>();
Node node = new Node(null, MESSAGES.labelConfiguration(config.getAbbv()), config);
line.add(node);
line.add(new Label(config.hasInstructionalMethod() ? config.getInstructionalMethod() : ""));
line.add(new UniTimeTable.NumberCell(config.getLimit() == null ? MESSAGES.configUnlimited() : config.getLimit().toString()));
line.add(new Label(""));
line.add(new Label(""));
line.add(new Label(""));
line.add(new Label(""));
iConfigs.put(config.getId(), node);
node.setRow(addRow(node, line));
for (Subpart subpart: config.getSubparts()) {
if (subpart.getParentId() == null)
addClasses(node, subpart, null);
}
}
项目:sig-seguimiento-vehiculos
文件:BasicToolBar.java
private void initializew3wPanel() {
w3wPanel = new HorizontalPanel();
w3wPanel.setSpacing(5);
w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
+ "border-radius: 5px 10px;" + "opacity: 0.8}");
w3wPanel.setStyleName("w3wPanel");
w3wPanel.setWidth("415px");
wordsLabel = new Label();
w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
.setText(UIMessages.INSTANCE.what3Words())
.setTitle("https://what3words.com/").build();
w3wAnchor.getElement().getStyle().setColor("#FF0000");
w3wAnchor.setVisible(false);
w3wPanel.add(w3wAnchor);
w3wPanel.add(wordsLabel);
}
项目:appinventor-extensions
文件:PropertiesPanel.java
/**
* Creates a new properties panel.
*/
public PropertiesPanel() {
// Initialize UI
VerticalPanel outerPanel = new VerticalPanel();
outerPanel.setWidth("100%");
componentName = new Label("");
componentName.setStyleName("ode-PropertiesComponentName");
outerPanel.add(componentName);
panel = new VerticalPanel();
panel.setWidth("100%");
panel.setStylePrimaryName("ode-PropertiesPanel");
outerPanel.add(panel);
initWidget(outerPanel);
}
项目:appinventor-extensions
文件:GalleryPage.java
/**
* Helper method called by constructor to initialize the app's title section
* @param container The container that title resides
*/
private void initAppTitle(Panel container) {
if (newOrUpdateApp()) {
// GUI for editable title container
if (editStatus==NEWAPP) {
// If it's new app, give a textual hint telling user this is title
titleText.setText(app.getTitle());
} else if (editStatus==UPDATEAPP) {
// If it's not new, just set whatever's in the data field already
titleText.setText(app.getTitle());
}
titleText.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
app.setTitle(titleText.getText());
}
});
titleText.addStyleName("app-desc-textarea");
container.add(titleText);
container.addStyleName("app-title-container");
} else {
Label title = new Label(app.getTitle());
title.addStyleName("app-title");
container.add(title);
}
}
项目:sig-seguimiento-vehiculos
文件:OpenProjectDialog.java
private FormPanel getFilePanel() {
VerticalLayoutContainer layoutContainer = new VerticalLayoutContainer();
file = new FileUploadField();
file.setName(UIMessages.INSTANCE.gdidFileUploadFieldText());
file.setAllowBlank(false);
layoutContainer.add(new FieldLabel(file, UIMessages.INSTANCE.file()),
new VerticalLayoutData(-18, -1));
layoutContainer.add(new Label(UIMessages.INSTANCE.maxFileSizeText()),
new VerticalLayoutData(-18, -1));
uploadPanel = new FormPanel();
uploadPanel.setMethod(Method.POST);
uploadPanel.setEncoding(Encoding.MULTIPART);
uploadPanel.setAction("fileuploadzip.do");
uploadPanel.setWidget(layoutContainer);
return uploadPanel;
}
项目:sig-seguimiento-vehiculos
文件:JoinDataDialog.java
private void createSeparatorPanel() {
separatorPanel = new HorizontalPanel();
separatorPanel.setSpacing(1);
separatorPanel.setWidth("100%");
separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
separatorPanel
.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
separatorPanel.add(new Label(UIMessages.INSTANCE
.separator(DEFAULT_CSV_SEPARATOR)));
separatorTextField = new TextField();
separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
separatorTextField.setWidth(30);
separatorPanel.add(separatorTextField);
}
项目:sig-seguimiento-vehiculos
文件:CustomExtentDialog.java
private Widget createPanel() {
VerticalLayoutContainer container = new VerticalLayoutContainer();
container.setScrollMode(ScrollMode.AUTO);
container.setSize("450px", "160px");
Label bboxLabel = new Label("Bbox (" + UIMessages.INSTANCE.lowerLeftXField() + ", " + UIMessages.INSTANCE.lowerLeftYField() +
", " + UIMessages.INSTANCE.upperRightXField() + ", " + UIMessages.INSTANCE.upperRightYField() + ")");
bboxLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD);
container.add(bboxLabel);
bboxField = new TextField();
bboxField.setEmptyText(UIMessages.INSTANCE.bboxFieldCustomExtent());
bboxField.setWidth("450px");
container.add(bboxField);
return container;
}
项目:appinventor-extensions
文件:SimpleNonVisibleComponentsPanel.java
/**
* Creates new component design panel for non-visible components.
*/
public SimpleNonVisibleComponentsPanel() {
// Initialize UI
VerticalPanel panel = new VerticalPanel();
panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
heading = new Label("");
heading.setStyleName("ya-NonVisibleComponentsHeader");
panel.add(heading);
componentsPanel = new FlowPanel();
componentsPanel.setStyleName("ode-SimpleUiDesignerNonVisibleComponents");
panel.add(componentsPanel);
initWidget(panel);
}
项目:sig-seguimiento-vehiculos
文件:CreateEmptyLayerTab.java
public VerticalPanel getEmptyPanel() {
VerticalPanel geoDataContainer = new VerticalPanel();
geoDataContainer.setSpacing(5);
geoDataContainer.setWidth("280px");
geoDataContainer.setSpacing(5);
geoDataContainer.add(new Label(UIMessages.INSTANCE
.createEmptyLayerToolText()));
createAttributes = new CheckBox();
createAttributes.setBoxLabel(UIMessages.INSTANCE
.celtAddAttributesLabel());
createAttributes.setValue(false);
geoDataContainer.add(createAttributes);
return geoDataContainer;
}
项目:calendar-component
文件:SimpleDayCell.java
public SimpleDayCell(VCalendar calendar, int row, int cell) {
this.calendar = calendar;
this.row = row;
this.cell = cell;
setStylePrimaryName("v-calendar-month-day");
caption = new Label();
caption.setStyleName("v-calendar-day-number");
caption.addMouseDownHandler(this);
caption.addMouseUpHandler(this);
add(caption);
bottomspacer = new HTML();
bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
bottomspacer.setWidth(3 + "em");
add(bottomspacer);
}
项目:empiria.player
文件:ItemViewCarrier.java
public ItemViewCarrier(String err) {
errorView = new FlowPanel();
errorView.setStyleName("qp-item-error");
Label errorLabel = new Label(err);
errorLabel.setStyleName("qp-item-error-text");
errorView.add(errorLabel);
}
项目:appinventor-extensions
文件:ReportList.java
/**
* Constructor of ReportWidgets
* @param report GalleryAppReport
*/
private ReportWidgets(final GalleryAppReport report) {
reportTextLabel = new Label(report.getReportText());
reportTextLabel.addStyleName("ode-ProjectNameLabel");
reportTextLabel.setWordWrap(true);
reportTextLabel.setWidth("200px");
appLabel = new Label(report.getApp().getTitle());
appLabel.addStyleName("primary-link");
DateTimeFormat dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();
Date dateCreated = new Date(report.getTimeStamp());
dateCreatedLabel = new Label(dateTimeFormat.format(dateCreated));
appAuthorlabel = new Label(report.getOffender().getUserName());
appAuthorlabel.addStyleName("primary-link");
reporterLabel = new Label(report.getReporter().getUserName());
reporterLabel.addStyleName("primary-link");
sendEmailButton = new Button(MESSAGES.buttonSendEmail());
deactiveAppButton = new Button(MESSAGES.labelDeactivateApp());
markAsResolvedButton = new Button(MESSAGES.labelmarkAsResolved());
seeAllActions = new Button(MESSAGES.labelSeeAllActions());
}
项目:empiria.player
文件:SourceListViewItemContentFactory.java
public IsWidget createSourceListContentWidget(SourcelistItemType type, String content, InlineBodyGeneratorSocket inlineBodyGeneratorSocket) {
switch (type) {
case IMAGE:
return new Image(content);
case TEXT:
return new Label(content);
case COMPLEX_TEXT:
Node node = getNode(content);
return inlineBodyGeneratorSocket.generateInlineBody(node);
}
return new Widget();
}
项目:empiria.player
文件:ItemController.java
protected Widget createTitleWidget(String index, String text) {
Panel titlePanel = new FlowPanel();
titlePanel.setStyleName(styleNames.QP_ITEM_TITLE());
Label indexLabel = new Label(index + ". ");
indexLabel.setStyleName(styleNames.QP_ITEM_TITLE_INDEX());
Label textLabel = new Label(text);
textLabel.setStyleName(styleNames.QP_ITEM_TITLE_TEXT());
titlePanel.add(indexLabel);
titlePanel.add(textLabel);
return titlePanel;
}
项目:DocIT
文件:DepartmentPanel.java
private boolean validate() {
resetFaultMessages();
boolean valid = true;
if (name.getText() == null || name.getText().length() == 0) {
lNameFault.setText("*");
faultMessages.add(new Label("Enter a valid name, please."));
valid = false;
}
return valid;
}
项目:DocIT
文件:EmployeePanel.java
private boolean validate() {
resetFaultMessages();
boolean valid = true;
if (name.getText() == null || name.getText().length() == 0) {
lNameFault.setText("*");
faultMessages.add(new Label("Enter a valid name, please."));
valid = false;
}
if (address.getText() == null || address.getText().length() == 0) {
lAddressFault.setText("*");
faultMessages.add(new Label("Enter a valid address, please."));
valid = false;
}
if (total.getText() == null || total.getText().length() == 0) {
lSalaryFault.setText("*");
faultMessages.add(new Label("Enter a valid salary, please."));
valid = false;
} else {
try {
Double.parseDouble(total.getText());
} catch (NumberFormatException e) {
lSalaryFault.setText("*");
faultMessages.add(new Label("Enter a valid salary, please."));
valid = false;
}
}
if (parent.getSelectedIndex() == 0) {
lParentFault.setText("*");
faultMessages.add(new Label("Select a valid parent department, please."));
valid = false;
}
return valid;
}
项目:appinventor-extensions
文件:GalleryGuiFactory.java
private GalleryAppWidget(final GalleryApp app) {
nameLabel = new Label(app.getTitle());
authorLabel = new Label(app.getDeveloperName());
numDownloadsLabel = new Label(Integer.toString(app.getDownloads()));
numLikesLabel = new Label(Integer.toString(app.getLikes()));
numViewsLabel = new Label(Integer.toString(app.getViews()));
numCommentsLabel = new Label(Integer.toString(app.getComments()));
image = new Image();
image.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
}
});
String url = gallery.getCloudImageURL(app.getGalleryAppId());
image.setUrl(url);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
image.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
项目:calendar-component
文件:SimpleDayCell.java
@Override
public void onMouseDown(MouseDownEvent event) {
if (calendar.isDisabled() || event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
return;
}
Widget w = (Widget) event.getSource();
clickedWidget = w;
if (w instanceof MonthItemLabel) {
// event clicks should be allowed even when read-only
monthEventMouseDown = true;
if (calendar.isItemMoveAllowed()
&& ((MonthItemLabel)w).getCalendarItem().isMoveable()) {
startCalendarItemDrag(event, (MonthItemLabel) w);
}
} else if (w == bottomspacer) {
if (extended) {
setLimitedCellHeight();
} else {
setUnlimitedCellHeight();
}
reDraw(true);
} else if (w instanceof Label) {
labelMouseDown = true;
} else if (w == this && !extended) {
MonthGrid grid = getMonthGrid();
if (grid.isEnabled() && calendar.isRangeSelectAllowed()) {
grid.setSelectionStart(this);
grid.setSelectionEnd(this);
}
}
event.stopPropagation();
event.preventDefault();
}
项目:appinventor-extensions
文件:CopyYoungAndroidProjectCommand.java
private Widget createPreviousCheckpointsTable(List<Project> checkpointProjects) {
Grid table = new Grid(1 + checkpointProjects.size(), 3);
table.addStyleName("ode-ProjectTable");
// Set the widgets for the header row.
table.getRowFormatter().setStyleName(0, "ode-ProjectHeaderRow");
table.setWidget(0, 0, new Label(MESSAGES.projectNameHeader()));
table.setWidget(0, 1, new Label(MESSAGES.projectDateCreatedHeader()));
table.setWidget(0, 2, new Label(MESSAGES.projectDateModifiedHeader()));
// Set the widgets for the rows representing previous checkpoints
DateTimeFormat dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();
int row = 1;
for (Project checkpointProject : checkpointProjects) {
table.getRowFormatter().setStyleName(row, "ode-ProjectRowUnHighlighted");
Label nameLabel = new Label(checkpointProject.getProjectName());
table.setWidget(row, 0, nameLabel);
Date dateCreated = new Date(checkpointProject.getDateCreated());
table.setWidget(row, 1, new Label(dateTimeFormat.format(dateCreated)));
Date dateModified = new Date(checkpointProject.getDateModified());
table.setWidget(row, 2, new Label(dateTimeFormat.format(dateModified)));
row++;
}
return table;
}
项目:EasyML
文件:PropertyTable.java
public PropertyTable(int rows, int cols) {
super();
grid = new Grid(rows, cols);
vp = new VerticalPanel();
this.setAlwaysShowScrollBars(false);
this.setSize("100%", "80%");
vp.setBorderWidth(0);
vp.add(grid);
this.add(vp);
properties = new HashMap<Property, Label>();
}
项目:EasyML
文件:PropertyTable.java
public void addProperty(Property p, int row) {
grid.setWidget(row, 0, new Label(p.getName()));
Label box = new Label();
box.setText(p.getValue());
grid.setWidget(row, 1, box);
box.setStyleName("propetybox");
properties.put(p, box);
}
项目:EasyML
文件:JobDescPopupPanel.java
public JobDescPopupPanel(String title) {
Label label = new Label(title);
label.setStyleName("bda-newjob-head");
verticalPanel.add(label);
verticalPanel.add(createGrid());
HorizontalPanel hpanel = new HorizontalPanel();
hpanel.setStyleName("bda-newjob-hpanel");
verticalPanel.add(errorLabel);
Button cancelBtn = new Button(Constants.studioUIMsg.cancel());
cancelBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
JobDescPopupPanel.this.hide();
}
});
hpanel.add(submitBtn);
hpanel.add(cancelBtn);
submitBtn.removeStyleName("gwt-Button");
cancelBtn.removeStyleName("gwt-Button");
submitBtn.addStyleName("button-style");
cancelBtn.addStyleName("button-style");
errorLabel.setStyleName("error-label");
verticalPanel.add(hpanel);
verticalPanel.addStyleName("bda-newjob");
this.setCloseEnable(false);
}
项目:appinventor-extensions
文件:ColumnLayout.java
@Override
public void apply(WorkAreaPanel workArea) {
// Clear base panel
workArea.clear();
// Horizontal panel to hold columns
HorizontalPanel horizontalPanel = new HorizontalPanel();
horizontalPanel.setSize("100%", "100%");
workArea.add(horizontalPanel);
// Initialize columns
for (Column column : columns) {
horizontalPanel.add(column.columnPanel);
workArea.getWidgetDragController().registerDropController(column);
// Add invisible dummy widget to prevent column from collapsing when it contains no boxes
column.columnPanel.add(new Label());
// Add boxes from layout
List<BoxDescriptor> boxes = column.boxes;
for (int index = 0; index < boxes.size(); index++) {
BoxDescriptor bd = boxes.get(index);
Box box = workArea.createBox(bd);
if (box != null) {
column.insert(box, index);
box.restoreLayoutSettings(bd);
}
}
}
workArea.getWidgetDragController().addDragHandler(changeDetector);
}
项目:EasyML
文件:PopupRetDirLeaf.java
public PopupRetDirLeaf(String path)
{
this.path = path;
setName(path);
label = new Label(getName());
this.setWidget(label);
}
项目:EasyML
文件:ScriptParameterPanel.java
/**
* Init UI
* @param editable Wheather is editable
*/
protected void init(boolean editable){
initGridHead( 3 );
inCountBox = new TextBox();
outCountBox = new TextBox();
inCountBox.setText( "" +widget.getInNodeShapes().size() );
outCountBox.setText( "" + widget.getOutNodeShapes().size());
paramsGrid.setVisible(true);
paramsGrid.setWidget( 1 , 0, new Label("Input File Number"));
paramsGrid.setWidget( 1, 1, new Label("Int"));
paramsGrid.setWidget( 1, 2, inCountBox );
inCountBox.setSize("95%", "100%");
inCountBox.setStyleName("okTextbox");
inCountBox.setEnabled(editable);
inCountBox.setTabIndex(0);
paramsGrid.setWidget( 2 , 0, new Label("Output File Number"));
paramsGrid.setWidget( 2, 1, new Label("Int"));
paramsGrid.setWidget( 2 , 2, outCountBox );
outCountBox.setSize("95%", "100%");
outCountBox.setStyleName("okTextbox");
outCountBox.setEnabled(editable);
outCountBox.setTabIndex(1);
scriptArea = new TextArea();
scriptArea.setText( widget.getProgramConf().getScriptContent());
this.add( paramsGrid );
this.add( new Label("Script"));
this.add( scriptArea );
}
项目:appinventor-extensions
文件:ComponentImportWizard.java
private Grid createUrlGrid() {
TextBox urlTextBox = new TextBox();
urlTextBox.setWidth("100%");
Grid grid = new Grid(2, 1);
grid.setWidget(0, 0, new Label("Url:"));
grid.setWidget(1, 0, urlTextBox);
return grid;
}
项目:EasyML
文件:SqlScriptFileConfigTable.java
public void deleteRow(int row){
this.removeRow(row);
for( int i = row; i < this.getRowCount() - 1; ++ i ){
Label label = (Label)this.getWidget(i,0);
label.setText(name + " " + i);
}
active();
}
项目:appinventor-extensions
文件:PropertiesPanel.java
/**
* Adds a new property to be displayed in the UI.
*
* @param property new property to be shown
*/
void addProperty(EditableProperty property) {
Label label = new Label(property.getCaption());
label.setStyleName("ode-PropertyLabel");
panel.add(label);
PropertyEditor editor = property.getEditor();
// Since UIObject#setStyleName(String) clears existing styles, only
// style the editor if it hasn't already been styled during instantiation.
if(!editor.getStyleName().contains("PropertyEditor")) {
editor.setStyleName("ode-PropertyEditor");
}
panel.add(editor);
}
项目:EasyML
文件:Pagination.java
/**
* Load the first page
*/
public void load(){
if(pageSize>pageType*2){
headStart = 1;
tailStart = lastPage - (pageType - 1);
grid.resize(1, (pageType*2+5));
grid.setWidget(0, 0, first);
grid.setWidget(0, 1, prev);
for(int count=2;count<(pageType+2);count++){
grid.setWidget(0, count, new Label(headStart+""));
headStart++;
}
grid.setText(0, (pageType+2), "...");
for(int count=(pageType+3);count<(pageType*2+3);count++){
grid.setWidget(0, count, new Label(tailStart+""));
tailStart++;
}
grid.setWidget(0, (pageType*2+3), next);
grid.setWidget(0, (pageType*2+4), last);
}else{
grid.resize(1, pageSize + 4);
grid.setWidget(0, 0, first);
grid.setWidget(0, 1, prev);
for(int count=2;count<pageSize+2;count++){
grid.setWidget(0, count, new Label((count-1)+""));
}
grid.setWidget(0, pageSize+2, next);
grid.setWidget(0, pageSize+3, last);
}
grid.getWidget(0, 2).removeStyleName("gwt-Label");
grid.getWidget(0, 2).addStyleName("admin-page-selected");
}
项目:unitimes
文件:InstructorsTable.java
protected Widget getCell(final InstructorInterface instructor, final InstructorsColumn column, final int idx) {
switch (column) {
case ID:
if (instructor.getExternalId() == null) {
Image warning = new Image(RESOURCES.warning());
warning.setTitle(MESSAGES.warnInstructorHasNoExternalId(instructor.getFormattedName()));
return warning;
} else {
return new Label(instructor.getExternalId());
}
case NAME:
return new Label(instructor.getFormattedName());
case POSITION:
return new Label(instructor.getPosition() == null ? "" : instructor.getPosition().getLabel());
case TEACHING_PREF:
if (instructor.getTeachingPreference() == null) {
return new Label("");
} else {
Label pref = new Label(instructor.getTeachingPreference().getName());
if (instructor.getTeachingPreference().getColor() != null)
pref.getElement().getStyle().setColor(instructor.getTeachingPreference().getColor());
return pref;
}
case MAX_LOAD:
return new Label(instructor.hasMaxLoad() ? NumberFormat.getFormat(CONSTANTS.teachingLoadFormat()).format(instructor.getMaxLoad()) : "");
case SELECTION:
return new SelectableCell(instructor);
case ATTRIBUTES:
AttributeTypeInterface type = iProperties.getAttributeTypes().get(idx);
List<AttributeInterface> attributes = instructor.getAttributes(type);
if (!attributes.isEmpty() && !isColumnVisible(getCellIndex(column) + idx)) {
setColumnVisible(getCellIndex(column) + idx, true);
}
return new AttributesCell(attributes);
default:
return null;
}
}
项目:unitimes
文件:RoomGroupsTable.java
protected Widget getCell(final GroupInterface group, final RoomGroupsColumn column, final int idx) {
switch (column) {
case NAME:
return new Label(group.getLabel() == null ? "" : group.getLabel(), false);
case ABBREVIATION:
return new Label(group.getAbbreviation() == null ? "" : group.getAbbreviation(), false);
case DEFAULT:
if (group.isDefault())
return new Image(RESOURCES.on());
else
return null;
case DEPARTMENT:
return new DepartmentCell(true, group.getDepartment());
case DESCRIPTION:
if (group.hasDescription()) {
HTML html = new HTML(group.getDescription());
html.setStyleName("description");
return html;
} else
return null;
case ROOMS:
if (group.hasRooms())
return new RoomsCell(group);
else
return null;
default:
return null;
}
}
项目:unitimes
文件:RoomFeaturesTable.java
protected Widget getCell(final FeatureInterface feature, final RoomFeaturesColumn column, final int idx) {
switch (column) {
case NAME:
return new Label(feature.getLabel() == null ? "" : feature.getLabel(), false);
case ABBREVIATION:
return new Label(feature.getAbbreviation() == null ? "" : feature.getAbbreviation(), false);
case TYPE:
if (feature.getType() == null)
return null;
else {
Label type = new Label(feature.getType().getAbbreviation(), false);
type.setTitle(feature.getType().getLabel());
return type;
}
case DEPARTMENT:
return new DepartmentCell(true, feature.getDepartment());
case DESCRIPTION:
if (feature.hasDescription()) {
HTML html = new HTML(feature.getDescription());
html.setStyleName("description");
return html;
} else
return null;
case ROOMS:
if (feature.hasRooms())
return new RoomsCell(feature);
else
return null;
default:
return null;
}
}