com.aerospike.aql.plugin.actions.AqlSnippetDialog.java Source code

Java tutorial

Introduction

Here is the source code for com.aerospike.aql.plugin.actions.AqlSnippetDialog.java

Source

/* 
 * Copyright 2012-2014 Aerospike, Inc.
 *
 * Portions may be licensed to Aerospike, Inc. under one or more contributor
 * license agreements.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.aerospike.aql.plugin.actions;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.jface.text.TextViewer;
import swing2swt.layout.BorderLayout;

public class AqlSnippetDialog extends Dialog {

    /**
     * @wbp.parser.constructor
     */
    public AqlSnippetDialog(Shell parentShell) {
        super(parentShell);
    }

    protected AqlSnippetDialog(IShellProvider parentShell) {
        super(parentShell);
    }

    @Override
    protected Control createDialogArea(Composite parent) {
        Composite container = new Composite(parent, SWT.BORDER);
        container.setLayout(new BorderLayout(0, 0));

        TextViewer textViewer = new TextViewer(container, SWT.BORDER);
        StyledText styledText = textViewer.getTextWidget();
        return container;
    }
}