/* * Copyright 2012-2015 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.wizards; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Path; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.ContainerSelectionDialog; import org.eclipse.swt.events.VerifyListener; import org.eclipse.swt.events.VerifyEvent; import com.aerospike.core.CoreActivator; import com.aerospike.core.preferences.PreferenceConstants; import swing2swt.layout.BorderLayout; import org.eclipse.swt.custom.StyledText; import org.eclipse.jface.text.TextViewer; import org.eclipse.swt.widgets.List; import org.eclipse.jface.viewers.ListViewer; /** * The "New" wizard page allows setting the container for the new file as well * as the file name. The page will only accept file name without the extension * OR with the extension that matches the expected one (mpe). */ public class InsertAQLWizardTextPage extends WizardPage { private ISelection selection; private IPreferenceStore store; /** * Constructor for SampleNewWizardPage. * * @param pageName */ public InsertAQLWizardTextPage(ISelection selection) { super("newAerospikeExamplePage"); setTitle("New Aerospike project"); setDescription("This wizard creates a new Aerospike project. This project can be used as a start for an Aerospike application in Java"); this.selection = selection; this.store = CoreActivator.getDefault().getPreferenceStore(); } /** * @see IDialogPage#createControl(Composite) */ public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); setControl(container); container.setLayout(new BorderLayout(0, 0)); TextViewer textViewer = new TextViewer(container, SWT.BORDER); StyledText aqlText = textViewer.getTextWidget(); aqlText.setLayoutData(BorderLayout.CENTER); } private void updateStatus(String message) { setErrorMessage(message); setPageComplete(message == null); } }