Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CodenameOne/src/com/codename1/nfc/NfcF.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
/// FeliCa (JIS X 6319-4) technology view -- the contactless protocol used
/// by Suica, PASMO, ICOCA and other Japanese transit / payment cards.
///
/// On iOS the app must declare its target system codes in the plist
/// `com.apple.developer.nfc.readersession.felica.systemcodes` and ship the
/// matching NFC entitlement -- the Codename One Maven plugin and build
/// daemon do this automatically when they see [Nfc] / [NfcF] in the
/// classpath.
/// On iOS the app must declare its target system codes in the `Info.plist` key
/// `com.apple.developer.nfc.readersession.felica.systemcodes`. Seeing [Nfc] /
/// [NfcF] on the classpath gets the builders to add CoreNFC, a default
/// `NFCReaderUsageDescription` and the reader-session formats entitlement, but
/// not this key: the codes are an argument to `setFelicaSystemCodes` at
/// runtime, which no build-time scan can see. Inject it yourself with the
/// `ios.plistInject` build hint.
public class NfcF extends TagTechnology {

/// IDm (Manufacturer Identifier). 8 bytes on a normal FeliCa tag; empty
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/

package com.codenameone.developerguide.snippets.generated;

import com.codename1.gpu.*;
import com.codename1.ui.*;
import com.codename1.ui.animations.*;
import com.codename1.ui.events.*;
import com.codename1.ui.geom.*;
import com.codename1.ui.layouts.*;
import com.codename1.ui.list.*;
import com.codename1.ui.plaf.*;
import com.codename1.ui.util.*;
import com.codename1.components.*;
import com.codename1.charts.models.*;
import com.codename1.charts.renderers.*;
import com.codename1.charts.views.*;
import com.codename1.capture.*;
import com.codename1.io.*;
import com.codename1.l10n.*;
import com.codename1.location.*;
import com.codename1.maps.*;
import com.codename1.media.*;
import com.codename1.messaging.*;
import com.codename1.payment.*;
import com.codename1.processing.*;
import com.codename1.properties.*;
import com.codename1.push.*;
import com.codename1.security.*;
import com.codename1.social.*;
import com.codename1.ui.spinner.*;
import java.io.*;
import java.util.*;
import com.codename1.annotations.Route;
import com.codename1.annotations.RouteParam;
import com.codename1.ui.Form;

class DeepLinksRoutingJava002Snippet {


Object context;
Object url;
Object value;
Object body;
Object event;
String apiKey = "test-key";
String myHttpsURL = "https://example.com";
java.util.List<String> validKeysList = new java.util.ArrayList<>();
Image myImage;
Graphics graphics;
Graphics g;
GraphicsDevice device;
Form form;
Form hi;
Container cnt;
Container myForm;
Component component;
Button button;
MultiButton myMultiButton;
Label label;
BrowserComponent browserComponent;
Resources theme;

// tag::deep-links-routing-java-002[]
public class Routes {
@Route("/home")
public static Form home() {
return new HomeForm();
}

@Route("/users/:id")
public static Form profile(@RouteParam("id") String id) {
return new ProfileForm(id);
}
}
// end::deep-links-routing-java-002[]

static class HomeForm extends Form { }
static class ProfileForm extends Form { ProfileForm(String id) { } }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/

package com.codenameone.developerguide.snippets.generated;

import com.codename1.gpu.*;
import com.codename1.ui.*;
import com.codename1.ui.animations.*;
import com.codename1.ui.events.*;
import com.codename1.ui.geom.*;
import com.codename1.ui.layouts.*;
import com.codename1.ui.list.*;
import com.codename1.ui.plaf.*;
import com.codename1.ui.util.*;
import com.codename1.components.*;
import com.codename1.charts.models.*;
import com.codename1.charts.renderers.*;
import com.codename1.charts.views.*;
import com.codename1.capture.*;
import com.codename1.io.*;
import com.codename1.l10n.*;
import com.codename1.location.*;
import com.codename1.maps.*;
import com.codename1.media.*;
import com.codename1.messaging.*;
import com.codename1.payment.*;
import com.codename1.processing.*;
import com.codename1.properties.*;
import com.codename1.push.*;
import com.codename1.security.*;
import com.codename1.social.*;
import com.codename1.ui.spinner.*;
import java.io.*;
import com.codename1.router.PopReason;
import com.codename1.router.PopGuard;
import java.util.*;
import com.codename1.annotations.Route;
import com.codename1.annotations.RouteParam;
import com.codename1.ui.Form;

class DeepLinksRoutingJava005Snippet {


Object context;
Object url;
Object value;
Object body;
Object event;
String apiKey = "test-key";
String myHttpsURL = "https://example.com";
java.util.List<String> validKeysList = new java.util.ArrayList<>();
Image myImage;
Graphics graphics;
Graphics g;
GraphicsDevice device;
Form form;
Form hi;
Container cnt;
Container myForm;
Component component;
Button button;
MultiButton myMultiButton;
Label label;
BrowserComponent browserComponent;
Resources theme;

void snippet() throws Exception {
// tag::deep-links-routing-java-005[]
editForm.setPopGuard(new PopGuard() {
public boolean canPop(Form form, PopReason reason) {
if (!isDirty()) {
return true;
}
// Discard is the ok command, so it returns true and the pop
// proceeds. The back key fires the cancel command, which means
// dismissing this dialog keeps the user on the form.
return Dialog.show("Discard changes?", "You have unsaved edits.",
"Discard", "Stay");
}
});
// end::deep-links-routing-java-005[]
}

Form editForm;
boolean isDirty() { return false; }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Copyright (c) 2012, Codename One and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Codename One designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Codename One through http://www.codenameone.com/ if you
* need additional information or have any questions.
*/

package com.codenameone.developerguide.snippets.generated;

import com.codename1.gpu.*;
import com.codename1.ui.*;
import com.codename1.ui.animations.*;
import com.codename1.ui.events.*;
import com.codename1.ui.geom.*;
import com.codename1.ui.layouts.*;
import com.codename1.ui.list.*;
import com.codename1.ui.plaf.*;
import com.codename1.ui.util.*;
import com.codename1.components.*;
import com.codename1.charts.models.*;
import com.codename1.charts.renderers.*;
import com.codename1.charts.views.*;
import com.codename1.capture.*;
import com.codename1.io.*;
import com.codename1.l10n.*;
import com.codename1.location.*;
import com.codename1.maps.*;
import com.codename1.media.*;
import com.codename1.messaging.*;
import com.codename1.payment.*;
import com.codename1.processing.*;
import com.codename1.properties.*;
import com.codename1.push.*;
import com.codename1.security.*;
import com.codename1.social.*;
import com.codename1.ui.spinner.*;
import java.io.*;
import com.codename1.sensors.*;
import java.util.*;


class DeviceInputAndFormFactorsJava001Snippet {


Object context;
Object url;
Object value;
Object body;
Object event;
String apiKey = "test-key";
String myHttpsURL = "https://example.com";
java.util.List<String> validKeysList = new java.util.ArrayList<>();
Image myImage;
Graphics graphics;
Graphics g;
GraphicsDevice device;
Form form;
Form hi;
Container cnt;
Container myForm;
Component component;
Button button;
MultiButton myMultiButton;
Label label;
BrowserComponent browserComponent;
Resources theme;

void snippet() throws Exception {
// tag::device-input-and-form-factors-java-001[]
myComponent.addPointerPressedListener(e -> {
PointerEvent pe = e.getPointerEvent();
if (pe.isSecondaryButton()) {
showContextMenu(pe.getX(), pe.getY());
}
System.out.println("pressure=" + pe.getPressure() + " type=" + pe.getPointerType());
});
// end::device-input-and-form-factors-java-001[]
}

Component myComponent;
void showContextMenu(int x, int y) { }

}
Loading
Loading