use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class FactPatternWidget method renderSingleFieldConstraint.
/**
* Applies a single field constraint to the given table, and start row.
*/
private void renderSingleFieldConstraint(final FlexTable inner, final int row, final SingleFieldConstraint constraint, final HasConstraints hasConstraints, boolean showBinding, final int tabs) {
// for offsetting, just a slight indent
final int col = 1;
inner.setWidget(row, 0, new HTML(" "));
if (constraint.getConstraintValueType() != SingleFieldConstraint.TYPE_PREDICATE) {
HorizontalPanel ebContainer = null;
if (constraint instanceof SingleFieldConstraintEBLeftSide) {
ebContainer = expressionBuilderLS((SingleFieldConstraintEBLeftSide) constraint, showBinding);
inner.setWidget(row, 0 + col, ebContainer);
} else {
inner.setWidget(row, 0 + col, fieldLabel(constraint, hasConstraints, showBinding, tabs * 20));
}
inner.setWidget(row, 1 + col, operatorDropDown(constraint, inner, row, 2 + col));
// Get first part of constraint.fieldName? #1=Fact1, #2=SubFact1
inner.setWidget(row, 2 + col, createValueEditor(constraint));
inner.setWidget(row, 3 + col, getConnectives().connectives(constraint));
if (ebContainer != null && ebContainer.getWidgetCount() > 0) {
if (ebContainer.getWidget(0) instanceof ExpressionBuilder) {
associateExpressionWithChangeHandler(inner, row, constraint, col, ebContainer);
}
}
} else if (constraint.getConstraintValueType() == SingleFieldConstraint.TYPE_PREDICATE) {
inner.setWidget(row, 1, predicateEditor(constraint));
inner.getFlexCellFormatter().setColSpan(row, 1, 5);
}
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project drools-wb by kiegroup.
the class FactPatternWidget method predicateEditor.
/**
* This provides an inline formula editor, not unlike a spreadsheet does.
*/
private Widget predicateEditor(final SingleFieldConstraint c) {
HorizontalPanel pred = new HorizontalPanel();
pred.setWidth("100%");
Image img = new Image(GuidedRuleEditorResources.INSTANCE.images().functionAssets());
img.setTitle(GuidedRuleEditorResources.CONSTANTS.FormulaBooleanTip());
pred.add(img);
if (c.getValue() == null) {
c.setValue("");
}
final TextBox box = new TextBox();
box.setText(c.getValue());
if (!this.readOnly) {
box.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
setModified(true);
c.setValue(box.getText());
}
});
box.setWidth("100%");
pred.add(box);
} else {
pred.add(new SmallLabel(c.getValue()));
}
return pred;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class MiniDialogPopupPanel method commonInit.
private void commonInit() {
addStyleName(ThemeStyles.INSTANCE.miniDialogPopupPanel());
verticalPanel_ = new VerticalPanel();
verticalPanel_.setStyleName(ThemeStyles.INSTANCE.miniDialogContainer());
// title bar
HorizontalPanel titleBar = new HorizontalPanel();
titleBar.setWidth("100%");
captionLabel_ = new Label();
captionLabel_.setStyleName(ThemeStyles.INSTANCE.miniDialogCaption());
titleBar.add(captionLabel_);
titleBar.setCellHorizontalAlignment(captionLabel_, HasHorizontalAlignment.ALIGN_LEFT);
HorizontalPanel toolsPanel = new HorizontalPanel();
toolsPanel.setStyleName(ThemeStyles.INSTANCE.miniDialogTools());
ToolbarButton hideButton = new ToolbarButton(new ImageResource2x(ThemeResources.INSTANCE.closeChevron2x()), new ClickHandler() {
public void onClick(ClickEvent event) {
MiniDialogPopupPanel.this.hideMiniDialog();
}
});
hideButton.setTitle("Close");
toolsPanel.add(hideButton);
titleBar.add(toolsPanel);
titleBar.setCellHorizontalAlignment(toolsPanel, HasHorizontalAlignment.ALIGN_RIGHT);
verticalPanel_.add(titleBar);
// main widget
verticalPanel_.add(createMainWidget());
setWidget(verticalPanel_);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class RPubsUploadDialog method showProgressPanel.
private void showProgressPanel() {
// disable continue button
continueButton_.setVisible(false);
updateButton_.setVisible(false);
createButton_.setVisible(false);
if (previewButton_ != null)
previewButton_.setVisible(false);
enableOkButton(false);
// add progress
HorizontalPanel progressPanel = new HorizontalPanel();
ProgressImage progressImage = new ProgressImage(CoreResources.INSTANCE.progress_gray());
progressImage.addStyleName(RESOURCES.styles().progressImage());
progressImage.show(true);
progressPanel.add(progressImage);
progressPanel.add(new Label(RPubsUploader.PROGRESS_MESSAGE));
addLeftWidget(progressPanel);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class NewDirectoryPage method onAddWidgets.
@Override
protected void onAddWidgets() {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
HorizontalPanel panel = new HorizontalPanel();
panel.addStyleName(styles.wizardMainColumn());
// create the dir name label
dirNameLabel_ = new Label("Directory name:");
dirNameLabel_.addStyleName(styles.wizardTextEntryLabel());
// top panel widgets
onAddTopPanelWidgets(panel);
// dir name
VerticalPanel namePanel = new VerticalPanel();
namePanel.addStyleName(styles.newProjectDirectoryName());
namePanel.add(dirNameLabel_);
txtProjectName_ = new TextBox();
txtProjectName_.setWidth("100%");
txtProjectName_.getElement().setAttribute("spellcheck", "false");
namePanel.add(txtProjectName_);
panel.add(namePanel);
addWidget(panel);
onAddBodyWidgets();
addSpacer();
// project dir
newProjectParent_ = new DirectoryChooserTextBox("Create project as subdirectory of:", txtProjectName_);
addWidget(newProjectParent_);
// if git is available then add git init
UIPrefs uiPrefs = RStudioGinjector.INSTANCE.getUIPrefs();
SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
HorizontalPanel optionsPanel = null;
if (getOptionsSideBySide())
optionsPanel = new HorizontalPanel();
chkGitInit_ = new CheckBox("Create a git repository");
chkGitInit_.addStyleName(styles.wizardCheckbox());
if (sessionInfo.isVcsAvailable(VCSConstants.GIT_ID)) {
chkGitInit_.setValue(uiPrefs.newProjGitInit().getValue());
chkGitInit_.getElement().getStyle().setMarginRight(7, Unit.PX);
if (optionsPanel != null) {
optionsPanel.add(chkGitInit_);
} else {
addSpacer();
addWidget(chkGitInit_);
}
}
// Initialize project with packrat
chkPackratInit_ = new CheckBox("Use packrat with this project");
chkPackratInit_.setValue(uiPrefs.newProjUsePackrat().getValue());
if (!sessionInfo.getPackratAvailable()) {
chkPackratInit_.setValue(false);
chkPackratInit_.setVisible(false);
}
if (optionsPanel != null) {
optionsPanel.add(chkPackratInit_);
} else {
addSpacer();
addWidget(chkPackratInit_);
}
if (optionsPanel != null) {
addSpacer();
addWidget(optionsPanel);
}
}
Aggregations