use of com.google.gwt.user.client.ui.Label in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initProjectOptions.
private void initProjectOptions() {
grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
state = new ListBox();
for (ProjectState stateValue : ProjectState.values()) {
state.addItem(Util.toLongString(stateValue), stateValue.name());
}
saveEnabler.listenTo(state);
grid.add(AdminConstants.I.headingProjectState(), state);
submitType = new ListBox();
for (final SubmitType type : SubmitType.values()) {
submitType.addItem(Util.toLongString(type), type.name());
}
submitType.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
setEnabledForUseContentMerge();
}
});
saveEnabler.listenTo(submitType);
grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
contentMerge = newInheritedBooleanBox();
saveEnabler.listenTo(contentMerge);
grid.add(AdminConstants.I.useContentMerge(), contentMerge);
newChangeForAllNotInTarget = newInheritedBooleanBox();
saveEnabler.listenTo(newChangeForAllNotInTarget);
grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
requireChangeID = newInheritedBooleanBox();
saveEnabler.listenTo(requireChangeID);
grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
if (Gerrit.info().receive().enableSignedPush()) {
enableSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(enableSignedPush);
grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
requireSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(requireSignedPush);
grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
}
rejectImplicitMerges = newInheritedBooleanBox();
saveEnabler.listenTo(rejectImplicitMerges);
grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
enableReviewerByEmail = newInheritedBooleanBox();
saveEnabler.listenTo(enableReviewerByEmail);
grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
maxObjectSizeLimit = new NpTextBox();
saveEnabler.listenTo(maxObjectSizeLimit);
effectiveMaxObjectSizeLimit = new Label();
effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
HorizontalPanel p = new HorizontalPanel();
p.add(maxObjectSizeLimit);
p.add(effectiveMaxObjectSizeLimit);
grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
use of com.google.gwt.user.client.ui.Label in project gerrit by GerritCodeReview.
the class GroupListScreen method initPageHeader.
private void initPageHeader() {
final HorizontalPanel hp = new HorizontalPanel();
hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
final Label filterLabel = new Label(AdminConstants.I.projectFilter());
filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
hp.add(filterLabel);
filterTxt = new NpTextBox();
filterTxt.setValue(match);
filterTxt.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent event) {
Query q = new Query(filterTxt.getValue()).open(event.getNativeKeyCode() == KeyCodes.KEY_ENTER);
if (match.equals(q.qMatch)) {
q.start(start);
}
if (q.open || !match.equals(q.qMatch)) {
if (query == null) {
q.run();
}
query = q;
}
}
});
hp.add(filterTxt);
add(hp);
}
use of com.google.gwt.user.client.ui.Label in project perun by CESNET.
the class UserExtSourceDetailTabItem method draw.
public Widget draw() {
this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin().trim()));
// MAIN TAB PANEL
VerticalPanel vp = new VerticalPanel();
vp.setSize("100%", "100%");
// The table
AbsolutePanel dp = new AbsolutePanel();
//dp.setStyleName("decoration");
final FlexTable menu = new FlexTable();
menu.setCellSpacing(5);
menu.setWidget(0, 0, new Image(LargeIcons.INSTANCE.worldIcon()));
Label memberName = new Label();
memberName.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin(), 40));
memberName.setStyleName("now-managing");
memberName.setTitle(userExtSource.getLogin());
menu.setWidget(0, 1, memberName);
int column = 2;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
if (JsonUtils.isExtendedInfoVisible()) {
menu.setHTML(0, column, "<strong>UES ID:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getId() + "</span>");
column++;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
menu.setHTML(0, column, "<strong>ES name:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getName() + "</span>");
column++;
menu.setHTML(0, column, " ");
menu.getFlexCellFormatter().setWidth(0, column, "25px");
column++;
menu.setHTML(0, column, "<strong>ES type:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getType() + "</span>");
}
dp.add(menu);
vp.add(dp);
vp.setCellHeight(dp, "30px");
tabPanel.clear();
tabPanel.add(new UserExtSourceSettingsTabItem(userExtSource), "Settings");
// Resize must be called after page fully displays
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
tabPanel.finishAdding();
}
});
vp.add(tabPanel);
this.contentWidget.setWidget(vp);
return getWidget();
}
use of com.google.gwt.user.client.ui.Label in project opennms by OpenNMS.
the class AlarmControl method doOnAdd.
public Element doOnAdd() {
LOG.info("AlarmControl.doOnAdd()");
final AlarmControlCss css = AlarmControlBundle.INSTANCE.css();
css.ensureInjected();
m_eventManager.addHandler(AlarmSeverityUpdatedEvent.TYPE, this);
this.setStylePrimaryName("leaflet-control-alarm");
this.addStyleName("leaflet-bar");
this.addStyleName("leaflet-control");
final Label label = new Label("Show Severity >=");
label.getElement().setAttribute("for", "alarmControl");
label.addStyleName(css.label());
m_severityBox = new ListBox(false);
m_severityBox.getElement().setId("alarmControl");
for (final AlarmSeverity sev : AlarmSeverity.values()) {
m_severityBox.addItem(sev.getLabel());
}
m_severityBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(final ChangeEvent event) {
final int selected = m_severityBox.getSelectedIndex();
LOG.info("new selection index = " + selected);
final String value = m_severityBox.getValue(selected);
LOG.info("new severity = " + value);
m_eventManager.fireEvent(new AlarmSeverityUpdatedEvent(AlarmSeverity.get(value)));
event.stopPropagation();
}
});
m_severityBox.addStyleName(css.label());
this.add(label);
this.add(m_severityBox);
LOG.info("AlarmControl.doOnAdd(): finished, returning: " + this.getElement());
m_componentTracker.ready(getClass());
return this.getElement();
}
use of com.google.gwt.user.client.ui.Label in project openremote by openremote.
the class AppActivityManager method onPlaceChange.
/**
* Deactivate the current activity, find the next one from our ActivityMapper,
* and start it.
* <p>
* The current activity's widget will be hidden immediately, which can cause
* flicker if the next activity provides its widget asynchronously. That can
* be minimized by decent caching. Perenially slow activities might mitigate
* this by providing a widget immediately, with some kind of "loading"
* treatment.
*/
public void onPlaceChange(Place newPlace) {
if (LOG.isLoggable(Level.FINE))
LOG.fine(name + " - on place change: " + newPlace);
AppActivity nextActivity = getNextActivity(newPlace);
if (LOG.isLoggable(Level.FINE))
LOG.fine(name + " - next activity is: " + nextActivity);
if (nextActivity == null) {
nextActivity = NULL_ACTIVITY;
}
if (currentActivity.equals(nextActivity)) {
if (LOG.isLoggable(Level.FINE))
LOG.fine(name + " - activity unchanged");
return;
} else {
if (LOG.isLoggable(Level.FINE))
LOG.fine(name + " - activity changed, transitioning");
}
if (startingNext) {
// The place changed again before the new current activity showed its widget
tryStopOrCancel(false);
currentActivity = NULL_ACTIVITY;
startingNext = false;
} else if (!currentActivity.equals(NULL_ACTIVITY)) {
showWidget(null);
if (LOG.isLoggable(Level.FINE))
LOG.fine(name + " - removing current activity registrations: " + activityRegistrations);
eventBus.removeAll(activityRegistrations);
activityRegistrations.clear();
tryStopOrCancel(true);
}
currentActivity = nextActivity;
if (currentActivity.equals(NULL_ACTIVITY)) {
Label nullLabel = new Label("No activity available for given place.");
nullLabel.getElement().getStyle().setColor("red");
nullLabel.getElement().getStyle().setFontWeight(Style.FontWeight.BOLD);
showWidget(nullLabel);
} else {
startingNext = true;
tryStart();
}
}
Aggregations