~ubuntu-branches/debian/sid/java-gnome/sid

« back to all changes in this revision

Viewing changes to src/bindings/org/gnome/unique/Command.java

  • Committer: Package Import Robot
  • Author(s): Guillaume Mazoyer
  • Date: 2014-05-19 17:39:50 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20140519173950-fnvrdx3b8fa94hj0
Tags: 4.1.3-1
* New upstream release.
* debian/control
  - Remove libunique dependency.
  - Remove DM-Upload-Allowed field.
  - Add dbus-x11 dependency to take doc screenshots.
  - Update Standards-Version to 3.9.4.
* debian/README.Maintainer
  - Add instructions for maintainers.
* debian/libjava-gnome-java.docs
  - Update documentation filenames.
* debian/libjava-gnome-java-doc.install
  - Fix HACKING file installation.
* debian/patches/02_unique_dependency.diff
  - Remove no longer needed patch (fixed upstream).
* debian/patches/02_build_python.diff
  - Add patch to fix build process (python2 env variable not found).
* debian/patches/03_build_doc_snapshots.diff (Closes: #748565)
  - Add patch to fix build process of the documentation (accessibilty bug).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * java-gnome, a UI library for writing GTK and GNOME programs from Java!
3
 
 *
4
 
 * Copyright © 2007-2012 Operational Dynamics Consulting, Pty Ltd and Others
5
 
 *
6
 
 * The code in this file, and the program it is a part of, is made available
7
 
 * to you by its authors as open source software: you can redistribute it
8
 
 * and/or modify it under the terms of the GNU General Public License version
9
 
 * 2 ("GPL") as published by the Free Software Foundation.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
 
 * FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details.
14
 
 *
15
 
 * You should have received a copy of the GPL along with this program. If not,
16
 
 * see http://www.gnu.org/licenses/. The authors of this program may be
17
 
 * contacted through http://java-gnome.sourceforge.net/.
18
 
 *
19
 
 * Linking this library statically or dynamically with other modules is making
20
 
 * a combined work based on this library. Thus, the terms and conditions of
21
 
 * the GPL cover the whole combination. As a special exception (the
22
 
 * "Classpath Exception"), the copyright holders of this library give you
23
 
 * permission to link this library with independent modules to produce an
24
 
 * executable, regardless of the license terms of these independent modules,
25
 
 * and to copy and distribute the resulting executable under terms of your
26
 
 * choice, provided that you also meet, for each linked independent module,
27
 
 * the terms and conditions of the license of that module. An independent
28
 
 * module is a module which is not derived from or based on this library. If
29
 
 * you modify this library, you may extend the Classpath Exception to your
30
 
 * version of the library, but you are not obligated to do so. If you do not
31
 
 * wish to do so, delete this exception statement from your version.
32
 
 */
33
 
package org.gnome.unique;
34
 
 
35
 
/*
36
 
 * Copied from the implementation in ResponseType.java
37
 
 */
38
 
 
39
 
import org.freedesktop.bindings.Constant;
40
 
 
41
 
/**
42
 
 * Predefined commands that can be sent from one Application to another.
43
 
 * 
44
 
 * <p>
45
 
 * If one of these responses constants fits your needs, it is recommended that
46
 
 * you make use of it.
47
 
 * 
48
 
 * <p>
49
 
 * If your needs require it, however, you can define your own responses codes
50
 
 * by extending this class. For example:
51
 
 * 
52
 
 * <pre>
53
 
 * public class NinjaCommand extends Command
54
 
 * {
55
 
 *     protected NinjaCommand(String nickname) {
56
 
 *         super(nickname);
57
 
 *     }
58
 
 * 
59
 
 *     public static final NinjaCommand HACK = new NinjaCommand(&quot;HACK&quot;);
60
 
 * 
61
 
 *     public static final NinjaCommand SLASH = new NinjaCommand(&quot;SLASH&quot;);
62
 
 * 
63
 
 *     public static final NinjaCommand BURN = new NinjaCommand(&quot;BURN&quot;);
64
 
 * }
65
 
 * </pre>
66
 
 * 
67
 
 * @author Andrew Cowie
68
 
 * @since 4.0.12
69
 
 * @deprecated
70
 
 */
71
 
/*
72
 
 * This implementation is identical to that used in our coverage GTK Dialogs
73
 
 * and their ResponseTypes. See that class for lots of detail.
74
 
 */
75
 
public class Command extends Constant
76
 
{
77
 
    private static int response;
78
 
 
79
 
    static {
80
 
        response = 1;
81
 
    }
82
 
 
83
 
    private Command(int ordinal, String nickname) {
84
 
        super(ordinal, nickname);
85
 
    }
86
 
 
87
 
    /**
88
 
     * Constructor to let developer define their own Commands, if necessary.
89
 
     * 
90
 
     * @param nickname
91
 
     *            Used mainly for debugging purposes. The String supplied
92
 
     *            should match the name of the constant as declared in your
93
 
     *            Command subclass.
94
 
     */
95
 
    /*
96
 
     * An unique ordinal is assigned automatically
97
 
     */
98
 
    protected Command(String nickname) {
99
 
        super(response++, nickname);
100
 
    }
101
 
 
102
 
    /*
103
 
     * It's not entirely necessary to have these here; we could just have
104
 
     * Dialog call the static methods in UniqueCommandOverride directly, but
105
 
     * the code seems a bit to have this as instance method here...
106
 
     */
107
 
    int getCommandId() {
108
 
        return UniqueCommandOverride.numOf(this);
109
 
    }
110
 
 
111
 
    /*
112
 
     * ... on the other hand, this is just clumsy, but it is at least
113
 
     * consistent with getResponseId() and likewise a bit cleaner.
114
 
     */
115
 
    static Command constantFor(int ordinal) {
116
 
        return UniqueCommandOverride.enumFor(ordinal);
117
 
    }
118
 
 
119
 
    /**
120
 
     * Generally interpreted to mean that the receiving instance should
121
 
     * {@link org.gnome.gtk.Window#present() present()} itself.
122
 
     * 
123
 
     * @since 4.0.12
124
 
     */
125
 
    public static final Command ACTIVATE = new Command(UniqueCommand.ACTIVATE, "ACTIVATE");
126
 
 
127
 
    public static final Command NEW = new Command(UniqueCommand.NEW, "NEW");
128
 
 
129
 
    public static final Command OPEN = new Command(UniqueCommand.OPEN, "OPEN");
130
 
 
131
 
    public static final Command CLOSE = new Command(UniqueCommand.CLOSE, "CLOSE");
132
 
}