ProgressIndicator
Hi all! I'm very disappointed because I can't just do a progress indicator works.
See my code:
String exportedFile = null; try { Task<String> worker = new Task<String>() { @Override protected String call() throws Exception { ProcessFiles processFiles = new ProcessFiles(sourceFile, savedSearch, outputFileName); return processFiles.execute(); } }; getIndicator().progressProperty().bind(worker.progressProperty()); Thread t = new Thread(worker); t.setDaemon(true); t.start(); exportedFile = worker.get(); } catch (InterruptedException | ExecutionException e) { MessagesDialogs.showMessageDialog(null, ExportStrings.EXECUTION_FAILURE.getText(), null, Type.EXCEPTION, e); } MessagesDialogs.showMessageDialog(null, ExportStrings.FILE_EXPORTED_SUCCESSFULLY.getText(), String.join("", ExportStrings.EXPORTED_FILE_PATH.getText(), exportedFile), Type.INFO, null); setIndicator(null);
"ProcessFile" is a class dealing with CSV files and returns a path to the generated file, the product of the process. My intention is to show an indicator process during execution, but the indicator does not appear.
getIndicator method to build the process indicator:
public ProgressIndicator getIndicator() { if (indicator == null) { indicator = new ProgressIndicator(); primaryPane.add(indicator, 0, 4, 3, 1); } return indicator; }
Could someone help me?
Best regards
Vitor Eduardo
When you update the status of the worker thread? All sample is an example of competitive access service that illustrates what you try to do: JavaFX 2 - set
Tags: Java
Similar Questions
-
Change the color of ProgressIndicator
I need to change the blue color by default ProgressIndicator bar. I have not seen a color property in its inheritance hierarchy in the documentation. Fact happen in the latest version of the API?
Hello
Indeed, it is not currently available - I would recommend a feature request for this record. This can be found here:
https://www.BlackBerry.com/JIRA/secure/dashboard.jspa
Thank you!
Martin
-
time while using progressindicator and GaugeField
HII, when I use a progressIndicator and Gaugefield in animated form, how do I know how match time I'll give you that it ends in the same time whith the functioning of httpconnection for get data or send data to the server
no reliable way, no.
If you know how the file you download is great you can check the current status during the download of course.
otherwise, you can check how much you've downloaded, but you have no idea the percentage. -
ProgressIndicator in ListView's border and white background. Why?
Hello
If I "embed" one ProgressIndicator inside a ListView, there an ugly border and a white background. Looks like there is a TextField below the ProgressIndicator.
Why should he behave like this and how to fix it so that the progress indicator is transparent.
Thank you!
import javafx.application.Application; import javafx.collections.FXCollections; import javafx.scene.Scene; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.ProgressIndicator; import javafx.stage.Stage; import javafx.util.Callback; public class TestApp2 extends Application { public static void main(String[] args) { launch(args); } @Override public void start(final Stage stage) throws Exception { ListView<String> listView = new ListView<>(); listView.setItems(FXCollections.observableArrayList("test", "test")); listView.setCellFactory(new Callback<ListView<String>, ListCell<String>>() { @Override public ListCell<String> call(ListView<String> param) { return new ListCell<String>() { @Override protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!empty) { setGraphic(new ProgressIndicator()); } else { setGraphic(null); } } }; } }); Scene scene = new Scene(listView); stage.setScene(scene); stage.show(); } }
Hmm. I'm also on a Mac... It is probably a transient bug in one of the first versions of 8u40. Update to solve this problem?
-
ProgressIndicator turning more from 8u20
Hello
Since the upgrade to 8u20 my ProgressIndicator JavaFX no longer turns when you use the style of the Caspian.
There is no work around for this?
Import javafx.application.Application;
Import javafx.scene.Scene;
Import javafx.scene.control.ProgressIndicator;
Import javafx.stage.Stage;
SerializableAttribute public class TestApp2 extends Application {}
Public Shared Sub main (String [] args) {}
Launch();
}
@Override
public void start (steps) riser Exception {}
Application.setUserAgentStylesheet (Application.STYLESHEET_CASPIAN);
Scene = new scene (new ProgressIndicator());
stage.setScene (scene);
internship. Show();
}
}
Try progressIndicator.setStyle ("spin - fx - active: true;" "");
Also, could you file a bug on javafx - jira.kenai.com for this?
-
progressIndicator or statusIndicator on the button Save
Hello
I use jdeveloper 11.1.2.3.0
I would like to know which component I could use in the case of save button runs a heavy procedure on DB, which takes a few seconds.
I saw progressIndicator and statusIndicator.
But I do not know how to use them with the button Save.
Which of them I should use and how?
Thank you!!
It is not as simple as you implement a progress model that does the actual work. All this is quite some work. for just a backup button.
You may be interested in this solution http://www.oracle.com/technetwork/developer-tools/adf/learnmore/27-long-running-queries-169166.pdf (comes with the sample code for you to check!). That fits your use case best. Or take a look at http://www.oracle.com/technetwork/developer-tools/adf/learnmore/42-progressbarcolor-169184.pdf
Timo
-
How to remove the percentage indicator in the control of ProgressIndicator?
I try to use the ProgressIndicator to indicate progress during loading, but I would only circle indicator and not the text of percentage below the circle. Does anyone know how to delete or move to the right side of the circle as the circle itself?
Any help would be thank you very much. Thank you.Hi user,
You must add the style sheets for things operate.
final HBox root = new HBox(); Scene scene = new Scene(root, 500, 250); scene.getStylesheets().add("file:///C:/gui.css"); //currently i've placed them inside the C:/gui.css final ProgressIndicator ind = new ProgressIndicator(); ind.setId("myprogress"); ind.setProgress(0); Task t = new Task
(){ @Override protected Void call() throws Exception { while(ind.getProgress() < 1.0){ Thread.sleep(1000); ind.setProgress(ind.getProgress()+0.1); } return null; } }; new Thread(t).start(); root.getChildren().add(ind); GUI. CSS [C:/gui.css]
#myprogress .percentage { visibility: hidden; }
Many things in javafx is not accessible by hard coding, so you must use the style sheet. After all it is the easiest part of the design.
Thank you
Narayan. -
How can I change the color of ProgressIndicator? I need to change the blue color to green.
Thank youStep easy and simple to make green progressBar is:
ProgressBar bar = new ProgressBar(); bar.setProgress(50); ColorAdjust adjust = new ColorAdjust(); //Green HUE value adjust.setHue(-0.4); bar.setEffect(adjust);
Thank you.
Narayan -
ADF BC Jdev11.1.1.4 progressIndicator + survey problem
Hello
My case here:
I have to load a large file, do some checking and then insert rows in a table in DB.
I would like to indicate to the user the current status of the load using an af:poll and af:progressIndicator components.
The user select a file (af:inpuFile), then press a button 'load' that launch a popup with the progressIndicator.
I created a Thread with the load method and a BoundedRangeModel.
I managed to do everything I need to some extent:
-file loading works
-I can read each line of the file and d othe checks the data
My problem occurs when I try to insert the data into the DB in the thread.
I tried to use the bindingContainer of my page to insert lines, but I continue to have errors:
-First one is I tried the DCBindingContainer using the JSFUtils.getBindingContainer () of my thread-> got a NPE
-J' tried passing as argument the DCBindingContainer of my Bean (viewscope) support the thread-> error when trying to get my DCIteratorBinding
I tried to pass the DCIteratorBinding of my Bean to the Thread support-> always had an error
Someone at - it an idea of what I'm doing wrong?
Is there another way to get my DCIteratorBinding so I can insert lines in there?
Best regards
JackIt is not a service, just a method in the AM which is flush in the client interface. Inside of the AOS, you can access the entire data model and get each VO you like.
Timo
-
While the investigation into the issue of images do not hit any fly/scrolling in a Webview (http://supportforums.blackberry.com/t5/Native-Development/Issue-With-Scrolling-Images-In-Webview/m-p...) I came across the question if a user buys my in-app purchase then removes the application and reinstall the in-app purchase did not work.
First of all, in-app purchase is to remove the ads - it does that very well, but when the application is removed and reinstalled ads appear once more and I don't want to force consumers to pay twice, so I really need to get this fixed number as it is preventing me to release an update of my application.
I'm working out of this example: http://supportforums.blackberry.com/t5/Native-Development/Sample-Removing-In-App-Ads/m-p/2783323/hig... and have used it to create buying app for my application.
Here's my source, my main.qml of my application file code:
import bb.cascades 1.0 import bb.platform 1.0 import com.sample.payment 1.0 TabbedPane { id: tabbedPane property variant payment Menu.definition: MenuDefinition { id: appMenu actions: [ ActionItem { title: "About" imageSource: "asset:///IMG/ic_info.png" onTriggered: { aboutSheet.open() } }, ActionItem { title: "Contact Us" imageSource: "asset:///IMG/ic_email.png" onTriggered: { emailInvocation.query.uri = "mailto:[email protected]?subject=Shopping For eBay App: Contact" emailInvocation.query.updateQuery(); } }, ActionItem { id: upgradeAction title: "Remove Ads" imageSource: "asset:///IMG/ic_clear_list.png" onTriggered: { if (tabbedPane.payment) { /* replace the values in quotes "" below with the values from * your vendor account for this application's add-on. */ payment.mPaymentControl.pid = "{REMOVED}" payment.mPaymentControl.sku = "{REMOVED}" payment.mPaymentControl.name = "Remove Ads" payment.mPaymentControl.metadata = "Purchasing this will remove the adverts!" payment.mPaymentControl.getPrice(payment.mPaymentControl.pid, payment.mPaymentControl.sku); payment.mPaymentControl.purchase(payment.mPaymentControl.pid, payment.mPaymentControl.sku, payment.mPaymentControl.name, payment.mPaymentControl.metadata) } } attachedObjects: [ // Definition to hold the PaymentControl so it is only created when neccesary ComponentDefinition { id: paymentdef Container { id: payContainer onCreationCompleted: { console.log("Payment Definition Created - Checking for Existing Purchases") paymentControl.getExisting(true); } property alias mPaymentControl: paymentControl attachedObjects: [ PaymentServiceControl { id: paymentControl property string pid property string sku property string name property string metadata // Play receipt animation on purchase response onPurchaseResponseSuccess: { cpp.saveValueFor("removedAds", "23"); root.removedAds = 23; console.log("purchaseResponse - " + receiptString) } onInfoResponseError: { console.log("Purchase Error - " + errorCode + " - " + errorText) } onExistingPurchasesResponseSuccess: { if (receiptsString == "(No purchases)") { console.log("existing unable to find receipt") } else { console.log("existing receiptString - " + receiptsString) cpp.saveValueFor("removedAds", "23"); root.removedAds = 23; } console.log("existingPurchaseResponse Success - " + receiptsString) } } ] } } ] }, ActionItem { title: "Share App" imageSource: "asset:///IMG/ic_share.png" onTriggered: { invokeShare.trigger("bb.action.SHARE") } }, ActionItem { title: "More Apps" imageSource: "asset:///IMG/ic_buy.png" onTriggered: { invokebb.trigger("bb.action.OPEN") } } ] attachedObjects: [ Sheet { id: aboutSheet About { } }, Invocation { id: invokeShare query { mimeType: "text/plain" data: qsTr("Get your shopping done easily on your #BlackBerry10 with 'Shopping For eBay'; check it out in @BlackBerry World: http://appworld.blackberry.com/webstore/content/35964888/") invokeActionId: "bb.action.SHARE" } }, Invocation { id: invokebb query { mimeType: "text/html" uri: "appworld://vendor/64825/" invokeActionId: "bb.action.OPEN" } }, Invocation { id: emailInvocation query.mimeType: "text/plain" query.invokeTargetId: "sys.pim.uib.email.hybridcomposer" query.invokeActionId: "bb.action.SENDEMAIL" onArmed: { emailInvocation.trigger(emailInvocation.query.invokeActionId); } } ] } showTabsOnActionBar: false Tab { title: qsTr("Home") + Retranslate.onLocaleOrLanguageChanged imageSource: "IMG/101.Home.png" NavigationPane { id: navigationPane0 Page { onCreationCompleted: { root.removedAds = parseInt(cpp.getValueFor("removedAds", "")) if (root.removedAds != 23) { tabbedPane.payment = paymentdef.createObject(navigationPane0); } else { console.log("Not Creating Payment Definition, User has Already Paid To Remove Ads") } } id: page1 //actionBar actions //Title bar Container { id: root property int removedAds onRemovedAdsChanged: { if (removedAds == 23) { myAds.visible = false myAds2.visible = false appMenu.removeAction(upgradeAction) } } Container { id: myAds horizontalAlignment: HorizontalAlignment.Center layout: StackLayout { } MyAds { horizontalAlignment: HorizontalAlignment.Center topPadding: 15.0 } } Container { layout: DockLayout { } // To enable scrolling in the WebView, it is put inside a ScrollView. ScrollView { id: scrollView scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.None // We let the scroll view scroll in both x and y and enable zooming, // max and min content zoom property is set in the WebViews onMinContentScaleChanged // and onMaxContentScaleChanged signal handlers. scrollViewProperties { scrollMode: ScrollMode.Vertical pinchToZoomEnabled: true } //Webview } // ScrollView// A progress indicator that is used to show the loading status Container { bottomPadding: 25 horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Bottom ProgressIndicator { id: progressIndicator opacity: 0.0 } } } } // End of container } } } //End of first tab } //End of tabbedPane
Any help and advice in this regard would be greatly appricated.
Thanks in advance!
If you test using a sandbox past purchases account cannot be restored. Purchases made with a sandbox account did not get connected to the server, so if you try to restore (ex after you remove and then re - install the app even) then no purchase will be returned.
You can test your rollback logic with purchases in the same session of the app: open the app, make a purchase, try a restore, all this without closing the application.
The only other option would be to remove your account from the sandbox and try buying using real $$
-
Progress indicator overlap Webview
Hello
I have tried to solve this one for a while now and came on the Support Forums for help because I have absolutely no idea what is causing this to happen.
I use a webview and then using a progress meter to display the web page loading inside the webview. The only problem I have is that a thin black line appears at the bottom of the page and then the progress indicator support above it.
BlackBerry 10 UI guidelines should not be black lines on the screen; then, before I release my update, I want to get rid of that black line.
Any help would be greatly appricated, thank you
No I meant the top-level one who holds your WebView, this is my code (bits removed for clarity)...
Container { layout: DockLayout { } ScrollView { id: scrollView scrollViewProperties { scrollMode: ScrollMode.Both pinchToZoomEnabled: true } Container { background: Color.LightGray WebView { id: webView url: "http://www.google.co.uk" settings.viewport: { "width": "device-width", "initial-scale": 1.0 } [ ... removed ... ] } } } Container { horizontalAlignment: HorizontalAlignment.Center verticalAlignment: VerticalAlignment.Bottom bottomPadding: 30 ProgressIndicator { id: loadProgress opacity: 0.0 } }
-
Function call QML from C++ by signal... it does not work
Hello.
Please help me because I'm stuck the last day three...
Well
In main.qml
onComplete() / / signal... .to in button click
{
closeProgressBar();
}
function closeProgressBar() / / allows to stop the progress as dwonlaoding data from the internet bar had finished.
{
progressIndicator.stop ();
}
Now in my file app.c
Q_SIGNALS:
Sub rollback();
in my app.hpp
Emit Rollback();
but he calling is not my onComplete method...
and I am unable to stop my progressabar
pls help me...
As I did today my plug-in...
I am wating for your reply eagerly...
the connect statement is not correct. to take
Login.Complete.Connect (closeProgressBar)I suggest to connect the signal in the onCreationCompleted of the component slot so that runs only once.
I also suggest that you use some console.log statements to see if the slot is called.
Furthermore, you mixed hpp and c (or CPP) in your messages.
-
Question of width custom list.
listItemComponents: [ ListItemComponent { type: "item" Container { leftMargin: 5.0 topMargin: 5.0 layout: StackLayout { orientation: LayoutOrientation.TopToBottom } horizontalAlignment: HorizontalAlignment.Fill Container { layout: StackLayout { orientation: LayoutOrientation.LeftToRight } horizontalAlignment: HorizontalAlignment.Fill Label { text: ListItemData.agencyName // Apply a text style to create a title-sized font // with normal weight multiline: true horizontalAlignment: HorizontalAlignment.Fill textStyle { base: SystemDefaults.TextStyles.TitleText fontWeight: FontWeight.Normal } } ImageView { imageSource: ListItemData.statusIcon verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Right preferredWidth: 32.0 } } ProgressIndicator { fromValue: 100 toValue: 0 value: 50 verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Left } } } ]
Here, I have a custom list box. With a label on the left, a picture/icon on the right and a progress bar as to each item in the list.
The problem is, I can't get the icon/image aligned right, it follows right after the text.
That is to say.
| This is a test X |
| ------------------------------- |
what I want
| This is a test X |
| ------------------------------- |
Maybe my layout, I tried to add the horizontal fill everywhere, no change.
You can fill a container with the background color to make sure that the external container takes the entire available width.
If it doesn't, try setting preferredWidth (Infinity)
HorizontalAlignment.Right won't work in LeftToRight in cause of a bug.
There are several workarounds:
-Use DockLayout. This is not very practical because can overlap, but for short strings (menus, etc), it can work. Here is an example in C++:
http://supportforums.BlackBerry.com/T5/Cascades-development/list-item-image-size/m-p/2064721#M9602
-Insert an empty container with .spaceQuota (1) between the left and right elements. Divide the right margin of the element left and the left margin of the right item in two (because the average container won't let not their margins overlap).
PS Fill does not seem to work for StackLayout. Use rather preferredWidth/Height (Infinity).
-
navigation pane + network address
void ApplicationUI::help() { qDebug() << "help"; try { qDebug() << "here"; QmlDocument *qml = QmlDocument::create("asset:///Help.qml").parent(this); // Create root object for the UI // AbstractPane *root = qml->createRootObject
(); Page *new_Page = qml->createRootObject (); // AbstractPane *oldScene = Application::instance()->scene(); // myNavi = oldScene->findChild ("guestMenuNavigation"); myNavi2 = dynamic_cast (root); // myNavi2 = root->findChild ("guestMenuNavigation"); if (myNavi2){ myNavi2->push(new_Page); Application::instance()->setScene(myNavi2); }else{ qDebug() << "Unable find NavigationPane"; } QNetworkAccessManager* netManager = new QNetworkAccessManager(this); qDebug() << "here1"; const QUrl url("http://demo.netvariant.com/alkhaliji/mobile/data/categories.json"); QNetworkRequest request(url); QNetworkReply* reply = netManager->get(request); bool ok = connect(reply, SIGNAL(finished()), this, SLOT(onReplyFinished())); Q_ASSERT(ok); Q_UNUSED(ok); } catch(...) { } } void ApplicationUI::onReplyFinished() { qDebug() << "here2"; QNetworkReply* reply = qobject_cast (sender()); QString response; if (reply) { if (reply->error() == QNetworkReply::NoError) { const int available = reply->bytesAvailable(); if (available > 0) { const QByteArray data(reply->readAll()); // QVariant jsonva(QString(data)); //= Json::parse(QString(data), true); // JsonDataAccess json = JsonDataAccess::loadFromBuffer(QString(data)); JsonDataAccess jda; QVariant jsonva = jda.loadFromBuffer(QString(data)); //QVariantList list = jsonva.toList; QVariant list = jsonva; emit buildList(list); qDebug() << "here3"; } } reply->deleteLater(); } } void ApplicationUI::buildList(QVariant list) { qDebug() << "here4"; bb::cascades::QVariantListDataModel *listModel = new QVariantListDataModel(); ListView* custList = root->findChild ("customList"); if (custList != NULL) { QVariantMap map; qDebug() << "here5"; qDebug() << "unknown state"; QVariantMap childJsonv1a = list.toMap(); QVariantMap childJsonva2 = childJsonv1a["DATA"].toMap(); QVariant childJsonva = childJsonva2["categories"]; QVariantList childList = childJsonva.toList(); for (QList ::iterator it = childList.begin(); it != childList.end(); it++) { qDebug() << "here6"; map = it->toMap(); // map["negativeBalance"] = map.value("availableBalance").toString().startsWith("-"); listModel->append(map); } ActivityIndicator *mActivityIndicator = root->findChild< ActivityIndicator*>("activityIndicator"); mActivityIndicator->stop(); qDebug() << "here7"; custList->setDataModel(listModel); } } Help.QML
import bb.cascades 1.0 Page { Container { Container { preferredWidth: Infinity background: style.black TopBar { id: bar layoutProperties: StackLayoutProperties { spaceQuota: -1 } } layoutProperties: StackLayoutProperties { spaceQuota: -1 } } NetworkActivity { id: progressIndicator horizontalAlignment: HorizontalAlignment.Fill verticalAlignment: VerticalAlignment.Fill } Container { topPadding: 20 ListView { objectName: "customList" id: customList listItemComponents: [ ListItemComponent { Container { id: itemRoot background: ListItem.selected ? Color.Transparent : Color.Transparent Container { leftPadding: 30 topPadding: 10 rightPadding: 10 bottomPadding: 10 layout: StackLayout { orientation: LayoutOrientation.LeftToRight } Container { layout: StackLayout { orientation: LayoutOrientation.TopToBottom } layoutProperties: StackLayoutProperties { spaceQuota: 1 } Label { text: ListItemData.label textStyle.base: SystemDefaults.TextStyles.TitleText textStyle.color: Color.create("#ff333333") } } Container { verticalAlignment: VerticalAlignment.Center horizontalAlignment: HorizontalAlignment.Right layout: StackLayout { orientation: LayoutOrientation.LeftToRight } ImageView { imageSource: "asset:///images/ic_right_arrow.png" } } } Container { background: Color.create("#ffE0E0E0") preferredHeight: 1 Divider { maxHeight: 1 minHeight: 1 } } } } ] onTriggered: { } } } } attachedObjects: [ Style { id: style } ] }
the solution is page var = help.createObject ();
guestMenuNavigation.push (page);using this instead of using c++ to push and pop. The question, I have no qnetworkmanager of work by caching... How avoid caching?
-
are there similar control with UISegmenControl on ios
I noticed bbuijs includes
ActionBar ActivityIndicator ContextMenu GridList
Common controls
These controls and the common layouts are supported through BB6, BB7, PlayBook, BB10
BBMBubbles Button CheckBox Indicated Drop-down list ImageList LabelControlContainer PillButtons ProgressIndicator Option buttons ScreenMenu ScrollPanel Slider ToggleButton
are there similar control with UISegmenControl on ios
Seems to me looking "buttons of the pill?
This is in bbUI - https://github.com/blackberry/bbUI.js/wiki/Pill-Buttons
Maybe you are looking for
-
Hello! Is it possible to change the email address to iCloud which was created when the account was created? I understand that Apple ID are attached to an external mail (Gmail, for example), but I don't know that one. If you go to iCloud.com > mail >
-
When I try to download something, it stops downloading.
When I try to download something, it stops the download and I can't download anything.
-
Dv6-6060sa higher mAh Compatible battery
Hello Please can you let me know the part number for your highest mAh battery for my laptop DV6-6060sa? I'd like something around the mark 000mAh 10, if they are available? Thank you, Simon.
-
Autorun does not work for USB in Windows XP
Hi all I need to open a text file or word document automatically when I insert a USB into the computer. To do this, I created an AutoRun.inf with the following entries. [AutoRun]Open = MyFile.txt I put the file MyFile.txt and autorun.inf in the root
-
How to set the first character as selections in the EditField.
Hi friends, I am a third-party application that I have to set the first character as capital. so please help me how to set the first tank as capital.