当前位置: 首页>>代码示例>>Java>>正文


Java ResponseType类代码示例

本文整理汇总了Java中org.gnome.gtk.ResponseType的典型用法代码示例。如果您正苦于以下问题:Java ResponseType类的具体用法?Java ResponseType怎么用?Java ResponseType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResponseType类属于org.gnome.gtk包,在下文中一共展示了ResponseType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onResponse

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
@Override
public void onResponse(Dialog source, ResponseType response) {
    if (response == ResponseType.OK) {
        final Assistant assistant;

        if (split.getActive()) {
            assistant = new SplitAssistant();
        } else {
            assistant = new MergeAssistant();
        }

        // Focus on the assistant
        assistant.showAll();
    }

    // Hide the dialog
    this.hide();
    this.destroy();
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:20,代码来源:AssistantDialog.java

示例2: PreferencesDialog

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
public PreferencesDialog() {
    super(_("GNOME Split Preferences"), ui, false);

    // Border width
    this.setBorderWidth(12);

    // Add the notebook
    final Notebook notebook = new Notebook();
    notebook.show();
    this.add(notebook);

    // Add all the pages
    notebook.appendPage(this.createGeneralPage(), new Label(_("General")));
    notebook.appendPage(this.createInterfacePage(), new Label(_("Interface")));
    notebook.appendPage(this.createSplitPage(), new Label(_("Split")));
    notebook.appendPage(this.createMergePage(), new Label(_("Merge")));
    notebook.appendPage(this.createDesktopPage(), new Label(_("Desktop")));

    // Close button (save the configuration and close)
    this.addButton(Stock.CLOSE, ResponseType.CLOSE);

    // Connect classic signals
    this.connect((Window.DeleteEvent) this);
    this.connect((Dialog.Response) this);
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:26,代码来源:PreferencesDialog.java

示例3: InfoHeader

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
public InfoHeader() {
    super();

    // Add a close button
    this.addButton(Stock.CLOSE, ResponseType.CLOSE);

    // Create the label to display text
    this.label = new Label();
    this.label.setLineWrap(true);
    this.label.setUseMarkup(true);
    this.label.setJustify(Justification.LEFT);

    // Add the label
    this.add(this.label);

    // Connect signals
    this.connect((InfoBar.Close) this);
    this.connect((InfoBar.Response) this);
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:20,代码来源:InfoHeader.java

示例4: onResponse

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
@Override
public void onResponse(Dialog source, ResponseType response) {
    // Save preferences that cannot be saved using signals
    config.SPLIT_DIRECTORY = splitDirChooser.getCurrentFolder();
    config.MERGE_DIRECTORY = mergeDirChooser.getCurrentFolder();
    config.savePreferences();

    // Hide the dialog
    this.hide();
    this.destroy();
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:12,代码来源:PreferencesDialog.java

示例5: showInfo

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
/**
 * Show a message to inform the people from something normal.
 */
public void showInfo(String title, String body) {
    // Set the message type
    this.setMessageType(MessageType.INFO);

    // Set the default response
    this.setDefaultResponse(ResponseType.CLOSE);

    // Set the text of the label
    label.setLabel("<b>" + title + "</b>\n" + body);

    // Show the info bar
    this.showAll();
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:17,代码来源:InfoHeader.java

示例6: showWarning

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
/**
 * Show a message to inform the people from a warning.
 */
public void showWarning(String title, String body) {
    // Set the message type
    this.setMessageType(MessageType.WARNING);

    // Set the default response
    this.setDefaultResponse(ResponseType.CLOSE);

    // Set the text of the label
    label.setLabel("<b>" + title + "</b>\n" + body);

    // Show the info bar
    this.showAll();
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:17,代码来源:InfoHeader.java

示例7: onResponse

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
@Override
public void onResponse(InfoBar source, ResponseType response) {
    if (response == ResponseType.CLOSE) {
        // Just hide the info bar
        this.hide();
        this.destroy();
    }
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:9,代码来源:InfoHeader.java

示例8: AssistantDialog

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
public AssistantDialog() {
    super(_("Assistant"), ui, false);

    // This dialog should be modal
    this.setModal(true);

    // Border width
    this.setBorderWidth(12);

    // Add the label
    final Label label = new Label(_("What do you want to do?"));
    label.setUseMarkup(true);
    label.setLineWrap(true);
    label.setAlignment(0.0f, 0.5f);
    this.add(label);

    // Create a box to pack the two choices
    final VButtonBox box = new VButtonBox();
    box.setBorderWidth(12);
    box.setLayout(ButtonBoxStyle.SPREAD);
    this.add(box);

    // Create the two choices
    final RadioGroup group = new RadioGroup();
    split = new RadioButton(group, _("Split a file"));
    merge = new RadioButton(group, _("Merge several files"));

    // Add them to the page
    box.packStart(split, false, false, 0);
    box.packStart(merge, false, false, 0);

    // Add a button to turn on/off the assistant on start
    final CheckButton assistant = new CheckButton(_("_Show the assistant on start"));
    assistant.setActive(config.ASSISTANT_ON_START);
    this.add(assistant);

    // Connect check button signal
    assistant.connect(new Button.Clicked() {
        @Override
        public void onClicked(Button source) {
            // Save preferences
            config.ASSISTANT_ON_START = assistant.getActive();
            config.savePreferences();
        }
    });

    // Close button (save the configuration and close)
    this.addButton(Stock.CLOSE, ResponseType.CLOSE);
    this.addButton(Stock.OK, ResponseType.OK);

    // Connect classic signals
    this.connect((Window.DeleteEvent) this);
    this.connect((Dialog.Response) this);
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:55,代码来源:AssistantDialog.java

示例9: onDeleteEvent

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
@Override
public boolean onDeleteEvent(Widget source, Event event) {
    this.emitResponse(ResponseType.CLOSE);
    return false;
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:6,代码来源:AssistantDialog.java

示例10: onResponse

import org.gnome.gtk.ResponseType; //导入依赖的package包/类
@Override
public void onResponse(Dialog source, ResponseType response) {
    this.hide();
    this.destroy();
}
 
开发者ID:respawner,项目名称:gnome-split,代码行数:6,代码来源:AboutSoftDialog.java


注:本文中的org.gnome.gtk.ResponseType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。