List of usage examples for com.google.gwt.user.client.ui TabPanel TabPanel
public TabPanel()
From source file:org.dataconservancy.dcs.access.client.view.AdminView.java
License:Apache License
public AdminView() { adminPanel = new TabPanel(); adminPanel.setWidth("100%"); usersPanel = new FlowPanel(); usersPanel.setWidth("100%"); adminPanel.add(usersPanel, "Users"); saveButton = new Button("Save"); adminPanel.selectTab(0);// www . j av a 2 s . c o m }
From source file:org.dataconservancy.dcs.access.client.view.LoginView.java
License:Apache License
public LoginView()//DepositConfig depositConfig) { loginPanel = new TabPanel(); loginPanel.setWidth("100%"); loginPanel.setHeight("100%"); loginTab = new FlowPanel(); loginPanel.add(loginTab, "Login"); loginPanel.selectTab(0);/* ww w. j a v a2s. co m*/ Label explain = new Label("The SEAD Ingest UI allows simple SIPs to be created and uploaded."); explain.setStylePrimaryName("Explanation"); loginTab.add(explain); error = // Util.label("","ErrorField"); new Label(""); loginTab.add(error); userNameLbl = new Label(); regsiterLbl = Util.label("Register New User", "SimpleButton"); FlexTable tempTable = Util.createTable(""); Util.addColumn(tempTable, regsiterLbl); loginTab.add(tempTable); userDetails = new UserDetails(); // userDetails.depositConfig = depositConfig; // if (depositConfig == null) { loginTab.add(new Label("Login")); final FlexTable table = Util.createTable("User:", "Pass:"); userDetails.user_tb = new TextBox(); userDetails.pass_tb = new PasswordTextBox(); userDetails.user_tb.setText(deposit_user); userDetails.pass_tb.setText(deposit_pass); Util.addColumn(table, userDetails.user_tb, userDetails.pass_tb); loginTab.add(table); login = new Button("Login"); login.setStyleName("SimpleGreenButton"); loginTab.add(login); loginTab.add(new Label("Or")); googleLogin = new Button("Use Google Login"); googleLogin.setStyleName("SimpleGreenButton"); loginTab.add(googleLogin); // } else { //Application.main.remove(Application.ingestPanel); // loginTab.add(new Label("Logged in to: " + deposit_endpoint)); /*loginTab.add(Application.contentTab2,"Files"); loginTab.add(Application.contentTab3,"Deliverables"); Application.ingestPanel.add(Application.contentTab4,"Submission"); //Application.main.add(Application.ingestPanel);//,DockPanel.CENTER); centerPanel.add(Application.ingestPanel);//,DockPanel.CENTER);*/ // } }
From source file:org.drools.brms.client.AdminFeature.java
License:Apache License
public AdminFeature() { tab = new TabPanel(); tab.setWidth("100%"); tab.setHeight("100%"); tab.add(new CategoryManager(), "<img src='images/category_small.gif'/>Manage categories", true); tab.add(new StateManager(), "<img src='images/status_small.gif'/>Manage states", true); tab.add(new ArchivedAssetManager(), "<img src='images/backup_small.gif'/>Manage Archived Assets", true); tab.add(new BackupManager(), "<img src='images/backup_small.gif'/>Import Export", true); tab.selectTab(0);/*from w w w .ja v a 2 s . com*/ initWidget(tab); }
From source file:org.drools.brms.client.packages.PackageManagerView.java
License:Apache License
/** * This is used when you only want to view one package. * @param packageUUID The UUID of the package. *//*from w ww . j av a 2 s . c om*/ public PackageManagerView(String packageUUID, final String snapshotName) { tab = new TabPanel(); tab.setWidth("100%"); tab.setHeight("30%"); EditItemEvent editEvent = new EditItemEvent() { public void open(String key) { EditorLauncher.showLoadEditor(openedViewers, tab, key, (snapshotName != null)); } }; PackageExplorerWidget explorer = null; if (packageUUID == null) { explorer = new PackageExplorerWidget(editEvent); } else { explorer = new PackageExplorerWidget(editEvent, packageUUID, snapshotName); } tab.add(explorer, "<img src='images/explore.gif'/>Explore", true); tab.selectTab(0); initWidget(tab); }
From source file:org.drools.brms.client.packages.PackageSnapshotView.java
License:Apache License
public PackageSnapshotView() { layout = new FlexTable(); tab = new TabPanel(); tab.setWidth("100%"); tab.setHeight("100%"); VerticalPanel vert = new VerticalPanel(); vert.add(layout);/*from ww w.j a va2 s. c o m*/ Button rebuild = new Button("Rebuild snapshot binaries"); rebuild.setTitle( "Rebuilding the binaries may be needed if the BRMS software was updated. Otherwise it should not be needed."); rebuild.addClickListener(new ClickListener() { public void onClick(Widget arg0) { if (Window.confirm( "Rebuilding the snapshot binaries will take some time, and only needs to be done if" + " the BRMS itself has been updated recently. This will also cause the rule agents to load the rules anew." + " Are you sure you want to do this?")) { LoadingPopup.showMessage("Rebuilding snapshots. Please wait, this may take some time..."); RepositoryServiceFactory.getService().rebuildSnapshots(new GenericCallback() { public void onSuccess(Object data) { LoadingPopup.close(); Window.alert("Snapshots were rebuilt successfully."); } }); } } }); vert.add(rebuild); tab.add(vert, "<img src='images/package_snapshot.gif'>Snapshots</a>", true); layout.getCellFormatter().setWidth(0, 0, "28%"); service = RepositoryServiceFactory.getService(); refreshPackageList(); layout.setWidth("100%"); initWidget(tab); tab.selectTab(0); }
From source file:org.drools.brms.client.rulelist.AssetBrowser.java
License:Apache License
public AssetBrowser() { tab = new TabPanel(); tab.setWidth("100%"); tab.setHeight("100%"); tab.add(doExplorer(), "<img src='images/explore.gif'/>Explore", true); tab.selectTab(0);//from www . j a v a 2s . c om initWidget(tab); }
From source file:org.drools.guvnor.client.asseteditor.drools.modeldriven.ui.FromAccumulateCompositeFactPatternWidget.java
License:Apache License
@Override protected Widget getCompositeLabel() { ClickHandler leftPatternclick = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showFactTypeSelector(w);//from w ww.java 2 s . c o m } }; ClickHandler sourcePatternClick = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showSourcePatternSelector(w); } }; String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from accumulate") + "</div>"; DirtyableFlexTable panel = new DirtyableFlexTable(); int r = 0; if (pattern.getFactPattern() == null) { panel.setWidget(r++, 0, new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPattern() + "</font>", leftPatternclick, !this.readOnly)); } panel.setWidget(r++, 0, new HTML(lbl)); if (this.getFromAccumulatePattern().getSourcePattern() == null) { panel.setWidget(r++, 0, new ClickableLabel( "<br> <font color='red'>" + Constants.INSTANCE.clickToAddPattern() + "</font>", sourcePatternClick, !this.readOnly)); } else { IPattern rPattern = this.getFromAccumulatePattern().getSourcePattern(); RuleModellerWidget sourcePatternWidget; if (rPattern instanceof FactPattern) { sourcePatternWidget = new FactPatternWidget(this.getModeller(), getEventBus(), rPattern, true, true, this.readOnly); } else if (rPattern instanceof FromAccumulateCompositeFactPattern) { sourcePatternWidget = new FromAccumulateCompositeFactPatternWidget(this.getModeller(), this.getEventBus(), (FromAccumulateCompositeFactPattern) rPattern, this.readOnly); } else if (rPattern instanceof FromCollectCompositeFactPattern) { sourcePatternWidget = new FromCollectCompositeFactPatternWidget(this.getModeller(), this.getEventBus(), (FromCollectCompositeFactPattern) rPattern, this.readOnly); } else if (rPattern instanceof FromEntryPointFactPattern) { sourcePatternWidget = new FromEntryPointFactPatternWidget(this.getModeller(), this.getEventBus(), (FromEntryPointFactPattern) rPattern, this.readOnly); } else if (rPattern instanceof FromCompositeFactPattern) { sourcePatternWidget = new FromCompositeFactPatternWidget(this.getModeller(), this.getEventBus(), (FromCompositeFactPattern) rPattern, this.readOnly); } else { throw new IllegalArgumentException( "Unsupported pattern " + rPattern + " for right side of FROM ACCUMULATE"); } sourcePatternWidget.addOnModifiedCommand(new Command() { public void execute() { setModified(true); } }); panel.setWidget(r++, 0, addRemoveButton(sourcePatternWidget, new ClickHandler() { public void onClick(ClickEvent event) { if (Window.confirm(Constants.INSTANCE.RemoveThisBlockOfData())) { setModified(true); getFromAccumulatePattern().setSourcePattern(null); getModeller().refreshWidget(); } } })); } //REVISIT: Nested TabLayoutPanel does not work, its content is truncated. //TabLayoutPanel tPanel = new TabLayoutPanel(2, Unit.EM); TabPanel tPanel = new TabPanel(); DirtyableFlexTable codeTable = new DirtyableFlexTable(); int codeTableRow = 0; int codeTableCol = 0; codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='form-field'>Init:</div>")); final TextBox initField = new TextBox(); initField.setTitle("init code"); initField.setText(getFromAccumulatePattern().getInitCode()); initField.setEnabled(!this.readOnly); codeTable.setWidget(codeTableRow++, codeTableCol--, initField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='form-field'>Action:</div>")); final TextBox actionField = new TextBox(); actionField.setTitle("action code"); actionField.setText(getFromAccumulatePattern().getActionCode()); actionField.setEnabled(!this.readOnly); codeTable.setWidget(codeTableRow++, codeTableCol--, actionField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='form-field'>Reverse:</div>")); final TextBox reverseField = new TextBox(); reverseField.setTitle("reverse code."); reverseField.setText(getFromAccumulatePattern().getReverseCode()); reverseField.setEnabled(!this.readOnly); codeTable.setWidget(codeTableRow++, codeTableCol--, reverseField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='form-field'>Result:</div>")); final TextBox resultField = new TextBox(); resultField.setTitle("result code"); resultField.setText(getFromAccumulatePattern().getResultCode()); resultField.setEnabled(!this.readOnly); codeTable.setWidget(codeTableRow++, codeTableCol--, resultField); //panel.setWidget(r++, 0, codeTable); ScrollPanel codePanel = new ScrollPanel(); codePanel.add(codeTable); tPanel.add(codePanel, "Custom Code"); DirtyableFlexTable functionTable = new DirtyableFlexTable(); functionTable.setWidget(0, 0, new HTML("<div class='form-field'>Function:</div>")); final TextBox functionField = new TextBox(); functionField.setTitle("function code"); functionField.setText(getFromAccumulatePattern().getFunction()); functionField.setEnabled(!this.readOnly); functionTable.setWidget(0, 1, functionField); // panel.setWidget(r++, 0, functionTable); ScrollPanel functionPanel = new ScrollPanel(); functionPanel.add(functionTable); tPanel.add(functionPanel, "Function"); ChangeHandler changehandler = new ChangeHandler() { public void onChange(ChangeEvent event) { Widget sender = (Widget) event.getSource(); TextBox senderTB = (TextBox) event.getSource(); String code = senderTB.getText(); setModified(true); if (sender == initField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setInitCode(code); } else if (sender == actionField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setActionCode(code); } else if (sender == reverseField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setReverseCode(code); } else if (sender == resultField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setResultCode(code); } else if (sender == functionField) { getFromAccumulatePattern().clearCodeFields(); initField.setText(""); actionField.setText(""); reverseField.setText(""); resultField.setText(""); getFromAccumulatePattern().setFunction(code); } } }; initField.addChangeHandler(changehandler); actionField.addChangeHandler(changehandler); reverseField.addChangeHandler(changehandler); resultField.addChangeHandler(changehandler); functionField.addChangeHandler(changehandler); boolean useFunction = getFromAccumulatePattern().useFunctionOrCode() .equals(FromAccumulateCompositeFactPattern.USE_FUNCTION); tPanel.selectTab(useFunction ? 1 : 0); panel.setWidget(r++, 0, tPanel); return panel; }
From source file:org.drools.guvnor.client.asseteditor.drools.WorkingSetEditor.java
License:Apache License
private void refreshWidgets() { WorkingSetConfigData wsData = (WorkingSetConfigData) workingSet.getContent(); TabPanel tPanel = new TabPanel(); //tPanel.setWidth(800); ScrollPanel pnl = new ScrollPanel(); // pnl.setAutoWidth(true); //pnl.setClosable(false); pnl.setTitle("WS Definition"); //TODO {bauna} i18n // pnl.setAutoHeight(true); pnl.add(buildDoubleList(wsData));//from w w w .j a va 2 s . c o m tPanel.add(pnl, "WS Definition"); pnl = new ScrollPanel(); // pnl.setAutoWidth(true); //pnl.setClosable(false); //pnl.setTitle("WS Constraints"); //TODO {bauna} i18n // pnl.setAutoHeight(true); this.factsConstraintsgEditorPanel = new FactsConstraintsEditorPanel(this); pnl.add(this.factsConstraintsgEditorPanel); tPanel.add(pnl, "WS Constraints"); pnl = new ScrollPanel(); // pnl.setAutoWidth(true); //pnl.setClosable(false); pnl.setTitle("WS Custom Forms"); //TODO {bauna} i18n // pnl.setAutoHeight(true); this.customFormsEditorPanel = new CustomFormsEditorPanel(this); pnl.add(this.customFormsEditorPanel); tPanel.add(pnl, "WS Custom Forms"); tPanel.addBeforeSelectionHandler(new BeforeSelectionHandler<java.lang.Integer>() { public void onBeforeSelection(BeforeSelectionEvent<java.lang.Integer> arg0) { factsConstraintsgEditorPanel.fillSelectedFacts(); customFormsEditorPanel.fillSelectedFacts(); } }); tPanel.selectTab(0); initWidget(tPanel); }
From source file:org.drools.guvnor.client.asseteditor.RuleViewerWrapper.java
License:Apache License
private void render() { ArtifactEditor artifactEditor = new ArtifactEditor(asset, clientFactory, eventBus, this.isHistoricalReadOnly); RuleViewer ruleViewer = new RuleViewer(asset, clientFactory, eventBus, ruleViewerSettings); boolean readOnly = isHistoricalReadOnly || asset.isReadonly() || asset.isArchived() || (this.ruleViewerSettings != null && this.ruleViewerSettings.isStandalone()); Widget actionToolBar = clientFactory.getPerspectiveFactory().getAssetEditorActionToolbar("author", asset, ruleViewer.getAssetEditor(), clientFactory, eventBus, readOnly); layout.clear();//from w w w . j a v a 2 s .c om layout.add(actionToolBar); layout.add(messageWidget); TabPanel tabPanel = new TabPanel(); tabPanel.setWidth("100%"); ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.add(artifactEditor); tabPanel.add(scrollPanel, constants.Attributes()); scrollPanel = new ScrollPanel(); scrollPanel.add(ruleViewer); tabPanel.add(scrollPanel, constants.Edit()); tabPanel.selectTab(1); layout.add(tabPanel); }
From source file:org.drools.guvnor.client.modeldriven.ui.FromAccumulateCompositeFactPatternWidget.java
License:Apache License
@Override protected Widget getCompositeLabel() { ClickHandler leftPatternclick = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showFactTypeSelector(w);/*w ww . ja v a 2 s. c o m*/ } }; ClickHandler sourcePatternClick = new ClickHandler() { public void onClick(ClickEvent event) { Widget w = (Widget) event.getSource(); showSourcePatternSelector(w); } }; String lbl = "<div class='x-form-field'>" + HumanReadable.getCEDisplayName("from accumulate") + "</div>"; DirtyableFlexTable panel = new DirtyableFlexTable(); int r = 0; if (pattern.getFactPattern() == null) { panel.setWidget(r++, 0, new ClickableLabel("<br> <font color='red'>" + constants.clickToAddPattern() + "</font>", leftPatternclick, !this.readOnly)); } panel.setWidget(r++, 0, new HTML(lbl)); if (this.getFromAccumulatePattern().getSourcePattern() == null) { panel.setWidget(r++, 0, new ClickableLabel("<br> <font color='red'>" + constants.clickToAddPattern() + "</font>", sourcePatternClick, !this.readOnly)); } else { IPattern rPattern = this.getFromAccumulatePattern().getSourcePattern(); if (rPattern instanceof FactPattern) { this.sourcePatternWidget = new FactPatternWidget(this.getModeller(), rPattern, constants.All0with(), true, this.readOnly); } else if (rPattern instanceof FromAccumulateCompositeFactPattern) { this.sourcePatternWidget = new FromAccumulateCompositeFactPatternWidget(this.getModeller(), (FromAccumulateCompositeFactPattern) rPattern, this.readOnly); } else if (rPattern instanceof FromCollectCompositeFactPattern) { this.sourcePatternWidget = new FromCollectCompositeFactPatternWidget(this.getModeller(), (FromCollectCompositeFactPattern) rPattern, this.readOnly); } else if (rPattern instanceof FromCompositeFactPattern) { this.sourcePatternWidget = new FromCompositeFactPatternWidget(this.getModeller(), (FromCompositeFactPattern) rPattern, this.readOnly); } else { throw new IllegalArgumentException( "Unsuported pattern " + rPattern + " for right side of FROM ACCUMULATE"); } this.sourcePatternWidget.addOnModifiedCommand(new Command() { public void execute() { setModified(true); } }); panel.setWidget(r++, 0, addRemoveButton(this.sourcePatternWidget, new ClickHandler() { public void onClick(ClickEvent event) { if (Window.confirm(constants.RemoveThisBlockOfData())) { setModified(true); getFromAccumulatePattern().setSourcePattern(null); getModeller().refreshWidget(); } } })); } //REVISIT: Nested TabLayoutPanel does not work, its content is truncated. //TabLayoutPanel tPanel = new TabLayoutPanel(2, Unit.EM); TabPanel tPanel = new TabPanel(); DirtyableFlexTable codeTable = new DirtyableFlexTable(); int codeTableRow = 0; int codeTableCol = 0; codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='x-form-field'>Init:</div>")); final TextBox initField = new TextBox(); initField.setTitle("init code"); initField.setText(getFromAccumulatePattern().getInitCode()); codeTable.setWidget(codeTableRow++, codeTableCol--, initField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='x-form-field'>Action:</div>")); final TextBox actionField = new TextBox(); actionField.setTitle("action code"); actionField.setText(getFromAccumulatePattern().getActionCode()); codeTable.setWidget(codeTableRow++, codeTableCol--, actionField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='x-form-field'>Reverse:</div>")); final TextBox reverseField = new TextBox(); reverseField.setTitle("reverse code."); reverseField.setText(getFromAccumulatePattern().getReverseCode()); codeTable.setWidget(codeTableRow++, codeTableCol--, reverseField); codeTable.setWidget(codeTableRow, codeTableCol++, new HTML("<div class='x-form-field'>Result:</div>")); final TextBox resultField = new TextBox(); resultField.setTitle("result code"); resultField.setText(getFromAccumulatePattern().getResultCode()); codeTable.setWidget(codeTableRow++, codeTableCol--, resultField); //panel.setWidget(r++, 0, codeTable); ScrollPanel codePanel = new ScrollPanel(); codePanel.add(codeTable); //TODO: //codePanel.setDisabled(this.readOnly); tPanel.add(codePanel, "Custom Code"); DirtyableFlexTable functionTable = new DirtyableFlexTable(); functionTable.setWidget(0, 0, new HTML("<div class='x-form-field'>Function:</div>")); final TextBox functionField = new TextBox(); functionField.setTitle("function code"); functionField.setText(getFromAccumulatePattern().getFunction()); functionTable.setWidget(0, 1, functionField); // panel.setWidget(r++, 0, functionTable); ScrollPanel functionPanel = new ScrollPanel(); functionPanel.add(functionTable); //TODO: //functionPanel.setDisabled(this.readOnly); tPanel.add(functionPanel, "Function"); ChangeHandler changehandler = new ChangeHandler() { public void onChange(ChangeEvent event) { Widget sender = (Widget) event.getSource(); TextBox senderTB = (TextBox) event.getSource(); String code = senderTB.getText(); setModified(true); if (sender == initField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setInitCode(code); } else if (sender == actionField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setActionCode(code); } else if (sender == reverseField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setReverseCode(code); } else if (sender == resultField) { getFromAccumulatePattern().setFunction(null); functionField.setText(""); getFromAccumulatePattern().setResultCode(code); } else if (sender == functionField) { getFromAccumulatePattern().clearCodeFields(); initField.setText(""); actionField.setText(""); reverseField.setText(""); resultField.setText(""); getFromAccumulatePattern().setFunction(code); } } }; initField.addChangeHandler(changehandler); actionField.addChangeHandler(changehandler); reverseField.addChangeHandler(changehandler); resultField.addChangeHandler(changehandler); functionField.addChangeHandler(changehandler); boolean useFunction = getFromAccumulatePattern().useFunctionOrCode() .equals(FromAccumulateCompositeFactPattern.USE_FUNCTION); tPanel.selectTab(useFunction ? 1 : 0); //tPanel.setBorder(false); //tPanel.setBodyBorder(false); //tPanel.setWidth(200); //tPanel.setDisabled(this.readOnly); // functionTable.setVisible(useFunction); // codeTable.setVisible(!useFunction); panel.setWidget(r++, 0, tPanel); return panel; }