I want to use a SmartGWT Layout in Vaadin 7. I searched it everywhere; But, couldn't get the correct tutorial or any source code. Can anyone help me in this?
And, I tried in SmartGWT.
I created a Layout in SmartGWT.
public class SmartGWTLayout extends Widget {
public SmartGWTLayout() {
TabSet tabSet = new TabSet();
tabSet.setTabBarPosition(Side.TOP);
tabSet.setWidth(400);
tabSet.setHeight(200);
Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");
Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
tTab1.setPane(tImg1);
Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
tTab2.setPane(tImg2);
tabSet.addTab(tTab1);
tabSet.addTab(tTab2);
VLayout vLayout = new VLayout();
vLayout.setMembersMargin(15);
vLayout.addMember(tabSet);
vLayout.setAutoHeight();
vLayout.draw();
}
}
I called the Layout in Vaadin like this.
SmartGWTLayout aSmartGWTLayout = new SmartGWTLayout();
vaadinLayout.addComponent((Component)SmartGWTLayout);
And, I'm getting this error
HTTP Status 500 - java.lang.NoClassDefFoundError: com/google/gwt/core/shared/GWTBridge
type: Exception report
message: java.lang.NoClassDefFoundError: com/google/gwt/core/shared/GWTBridge
description: The server encountered an internal error that prevented it from fulfilling this request.
This is not the right way to use GWT Widget in Vaadin.
Try to follow this tutorial:
http://java.dzone.com/articles/using-gwt-widgets-vaadin-7
http://java.dzone.com/articles/using-gwt-widgets-vaadin-7-0
http://java.dzone.com/articles/using-gwt-widgets-vaadin-7-1
If you use the Vaadin Plugin for Eclipse: https://vaadin.com/eclipse
You can create a new Widget with all the features (necessary classes, xml files and widgetset) at:
Project/New/Other/Vaadin/Widget
Related
I am currently using the Google AdMob Xamarin component (version 6.12.0 - see https://components.xamarin.com/view/googleadmob) to display DFP interstitials and banner ads (displayed at different points within a tableview) on an iOS app. When I am debugging in Visual Studio 2013 I get the following output:
<Google:HTML> You are currently using version 6.12.0 of the SDK, which doesn't
officially support iOS 8. Please consider updating your SDK to the most recent
sdk version, 6.12.2, to get iOS 8 support, including a fix for smart banner
rendering in landscape mode. The latest SDK can be downloaded from
http://goo.gl/iGzfsP. A full list of release notes is available at
https://developers.google.com/mobile-ads-sdk/docs/admob/ios/rel-notes.
According to the Xamarin component's page, 6.12.0 does actually support iOS 8. Should I ignore the warning that I am getting? If not, how do I go about using 6.12.2 when the newest version of the component is only 6.12.0? Is it OK to stay with 6.12.0 or will it cause issues?
I have noticed that the banner ads aren't really displaying in the correct location on iOS8, they are slightly to the right and down from where they should be. Is this because of the SDK or some other change in iOS8 regarding how cells are displayed?
Below is how I display the banner ad:
public void InitialiseBanner(AdMobView property)
{
_bannerViewDelegate = new AdMobBannerViewDelegate();
_bannerView = new DFPBannerView();
float x = (CurrentWidth/2) - (AdvertWidth/2);
_bannerView.RootViewController = this;
_bannerView.BackgroundColor = UIColor.White;
_bannerView.Delegate = _bannerViewDelegate;
_bannerView.Frame = new RectangleF(x, 5, AdvertWidth, 50);
View.Frame = new RectangleF(0, 0, CurrentWidth, 50);
View.AddSubview(_bannerView);
_bannerView.AdUnitID = "/**UNITIDREMOVED**/" + property.AdAlias;
GADRequest request = GADRequest.Request;
.
.
.
_bannerView.LoadRequest(request);
View.BringSubviewToFront(_bannerView);
if (DeviceHelper.IsIos8OrGreater && RespondsToSelector(new Selector("separatorInset")))
{
_bannerView.LayoutMargins = UIEdgeInsets.Zero;
}
}
As for a normal banner, try loading your AdView Like this:
(This is my working example)
As a class level declaration, type this:
GADBannerView adView;
bool viewOnScreen = false;
// Get you own AdmobId from: http://www.google.com/ads/admob/
const string AdmobId = "<your admob id>";
Then in your viewDidLoad you can specify position of your banner and load it:
adView = new GADBannerView (size: GADAdSizeCons.Banner, origin: new PointF (0, UIScreen.MainScreen.Bounds.Height-100)) {
AdUnitID = AdmobId,
RootViewController = this
};
adView.DidReceiveAd += (sender, args) => {
if (!viewOnScreen) View.AddSubview (adView);
viewOnScreen = true;
};
adView.LoadRequest (GADRequest.Request);
I get the same error as well, but it doesn't actually matter. I also thought first that this was the issue but my setup was a bit wrong, i think that is the same for your code. In my example i just added my AdView to the MainView, but using custom cells you should be able to implement it in your UITable View. Also, have a look at the example provided in the components section. As for displaying DFP interstitials: There has to be something wrong with the setup as well, but i can't see it in the code you provided.
I started to work to user notification message similar to JGrowl for JavaFX.
public void newMessage()
{
final Stage newConnDialog = new Stage();
newConnDialog.initStyle(StageStyle.UNDECORATED);
newConnDialog.initModality(Modality.WINDOW_MODAL);
// Set pisition
newConnDialog.setX(1050); //secondStage.setX(primaryStage.getX() + 250);
newConnDialog.setY(150);
GridPane grid = new GridPane();
grid.setAlignment(Pos.CENTER);
grid.setHgap(5);
grid.setVgap(5);
grid.setPadding(new Insets(20, 20, 20, 20));
// text
Text productName = new Text("Test");
productName.setFont(Font.font("Verdana", 12));
grid.add(productName, 0, 2);
// Configure dialog size and background color
Scene aboutDialogScene = new Scene(grid, 200, 100, Color.WHITESMOKE);
newConnDialog.setScene(aboutDialogScene);
newConnDialog.show();
}
I have a basic knowledge about JavaFX. Can you give me some basic advice what will be the best way to implement this component. For example do I need to create new Stage or I can use other component as stage. How I can hide the component after 10 seconds activity and etc. Any advice will be highly appreciated.
P.S.
I found this example for JavaFX 1.3 Maybe it can be rewritten for JavaFX 2.2?
This is one possible solution by using the Enzo library:
// Create a custom Notification without icon
Notification info = new Notification("Title", "Info-Message");
// Show the custom notification
Notifier.INSTANCE.notify(info);
// Show a predefined Warning notification
Notifier.INSTANCE.notifyWarning("This is a warning");
Source
You can use the ControlsFx library to create notifications
http://docs.controlsfx.org/org/controlsfx/control/NotificationPane.html
you can try JFXToast see github
that can help you doing this work
this is an class for empelement toast in javafx
I'm a noob to monotouch and can't manage to add table views to flyoutnavigation controller. Does anyone have an example?
** update
My setup is a bit complicated and after much hacking managed to get the static table cells displayed on my storyboard with the below config.
tab bar controller
|
-tab 1
|
-tab 2 - nav controller
|
uiview controller A - flyout nav A --> uiview controller A1...A3
|
uiview controller B - flyout nav B --> tableview controller B1 (static cells)
I've cast the tableview controllers as uiview controllers on the flyout navs' setup thus allowing the tableviewcontroller to be displayed correctly and navigated to main uiview controllers via sergues. For example in the flyouts setup:
NavigationRoot = new RootElement ("FlyoutNavigationB") {
new Section ("Pages") {
new StringElement ("A Table View with static cells")
}
},
ViewControllers = new [] {
TableViewControllerB1 as UIViewController,
},
This hack seems to work but cleaner solutions are warmly invited (as I'm only 2weeks dev experience with monotouch) and feel a little saddened that I have uiview controllers sitting unattached on the storyboard without ability to do sergues via the flyout nav. It almost behaves like old school xib development.
Anyway I'm experimenting with tying this upto monotouch dialog now but not yet sure how. Comments most welcome to aid my learning :P
* update
Ok I think I got it working by creating a subclassed dialogviewcontroller. Then passing this subclass instance into the ViewControllers array in flyoutnavigationcontroller like so:
public partial class MyDvcController : DialogViewController
{
public MyDvcController (UINavigationController nav): base (UITableViewStyle.Grouped, null)
{
navigation = nav;
Root = new RootElement ("Demos"){
new Section ("Element API"){
new StringElement ("iPhone Settings Sample", DemoElementApi),
}
};
}
}
In my calling flyoutnav controller:
// Supply view controllers corresponding to menu items:
ViewControllers = new [] {
new UIViewController { View = new UILabel { Text = "Address txt" }, Title = "Address" },
new MyDvcController(NavigationController) as UIViewController
}
My wish list is almost complete...now how to add custom upickerviews with lovely transparent input accessory views wired to inputviews so they show automatically from calling monotouch dialog elements...hmmmm...another quest awaits...
Are you trying to push a second list over inside the flyout? I couldn't get it to work either.
I got it to work by modifying the source and redoing how the selection list is setup--but those changes are on my machine at work. I'll try to push those when I have a chance.
I updated RawMapViewDemoActivity.java in the Android Google Maps v2 sample app to programmatically create a MapView but map is not displayed. I just get a blank screen.
I replaced
mMapView = (MapView) findViewById(R.id.map);
with
GoogleMapOptions options = new GoogleMapOptions();
options.camera(new CameraPosition(new LatLng(0, 0), 15, 0, 0));
mMapView = new MapView(this, options);
mMapView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
What am I doing wrong?
Have you forwarded all the livecycle methods to the new MapView?
mMapView.onCreate(savedInstanceState);
Take a look at the API Reference
Sorry - I fixed this a while ago, but forgot to post the answer.
It seems that a MapView must be placed in a layout container before it will be correctly displayed. The following snippet shows what I did to make the sample work.
LinearLayout linearLayout = new LinearLayout(this);
GoogleMapOptions options = new GoogleMapOptions();
options.camera(new CameraPosition(new LatLng(0, 0), 1, 0, 0));
mMapView = new MapView(this, options);
linearLayout.addView(mMapView);
setContentView(linearLayout);
I ran into this error recently when trying to get all the page layouts in a publishing site (Microsoft.SharePoint.Publishing.PublishingWeb) from a custom layouts page in a subsite. The code worked on a VM server using a site created from the Enterprise Wiki site template. But when running on the development server the code encountered various exceptions.
Attempting to get around the error, I coded the class three different ways. All three worked in the VM, but all three threw an exception when used in the development server. Example:
private PageLayout FindPageLayout(PublishingWeb pubWeb, string examplePage)
{
/* The error occurs in this method */
if (pubWeb == null)
throw new ArgumentException("The pubWeb argument cannot be null.");
PublishingSite pubSiteCollection = new PublishingSite(pubWeb.Web.Site);
string pageLayoutName = "EnterpriseWiki.aspx"; // for testing purposes
PageLayout layout = null;
/* Option 1: Get page layout from collection with name of layout used as index
* Result: System.NullReferenceException from GetPageLayouts()
*/
layout = pubSiteCollection.PageLayouts["/_catalogs/masterpage/"+pageLayoutName];
/* Option 2: Bring up an existing publishing page, then find the layout of that page using the Layout property
* Result: Incorrect function COM exception
*/
SPListItem listItem = pubWeb.Web.GetListItem(examplePage);
PublishingPage item = PublishingPage.GetPublishingPage(listItem);
layout = item.Layout;
/* Option 3: Call "GetPageLayouts" and iterate through the results looking for a layout of a particular name
* Result: System.NullReferenceException thrown from Microsoft.SharePoint.Publishing.PublishingSite.GetPageLayouts()
*/
PageLayoutCollection layouts = pubSiteCollection.GetPageLayouts(true);
for(int i = 0; i < layouts.Count; i++)
{
// String Comparison based on the Page Layout Name
if (layouts[i].Name.Equals(pageLayoutName, StringComparison.InvariantCultureIgnoreCase))
layout = layouts[i];
}
return layout;
}
Here was the solution I found after a week or so:
Make sure that when you are getting your "PublishingWeb" object by calling that PublishingWeb.GetPublishingWeb(SPWeb) method that you are passing into it an SPWeb objec that has been fully retrieved. More specifically, I would make sure to call SPSite.OpenWeb on any website, as follows:
using (SPSite site = new SPSite(folder.ParentWeb.Url))
{
SPWeb web = site.OpenWeb();
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);
/* work with PublishingWeb here ... */
web.Close();
}
Once I made this simple change, all the errors mentioned in the question were cleared up, no matter in what context I called "GetPageLayouts" or "GetAvailablePageLayouts". The method documentation says this, and it really means it:
Use this method in order to access PublishingWeb behavior for an
instance of a SPWeb class that has already been retrieved.