use of org.eclipse.ui.dialogs.WizardNewFileCreationPage in project tdi-studio-se by Talend.
the class BusinessNewDiagramFileWizard method addPages.
/**
* @generated NOT
*/
public void addPages() {
myFileCreationPage = new WizardNewFileCreationPage(Messages.getString(//$NON-NLS-1$
"BusinessNewDiagramFileWizard.IntialNewEcoreDiagramFile"), //$NON-NLS-1$
mySelection) {
public void createControl(Composite parent) {
super.createControl(parent);
IContainer parentContainer = mySelectedModelFile.getParent();
String originalFileName = mySelectedModelFile.getProjectRelativePath().removeFileExtension().lastSegment();
//$NON-NLS-1$
String fileExtension = ".business_diagram";
String fileName = originalFileName + fileExtension;
for (int i = 1; parentContainer.getFile(new Path(fileName)).exists(); i++) {
fileName = originalFileName + i + fileExtension;
}
setFileName(fileName);
}
};
//$NON-NLS-1$
myFileCreationPage.setTitle(Messages.getString("BusinessNewDiagramFileWizard.DiagramFile"));
myFileCreationPage.setDescription(Messages.getString("BusinessNewDiagramFileWizard.CreateNewDiagram", //$NON-NLS-1$ //$NON-NLS-2$
BusinessProcessEditPart.MODEL_ID));
addPage(myFileCreationPage);
addPage(new RootElementSelectorPage());
}
use of org.eclipse.ui.dialogs.WizardNewFileCreationPage in project sling by apache.
the class AbstractNewSightlyFileWizard method init.
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.workbench = workbench;
fileCreationPage = new WizardNewFileCreationPage(pageTitle, selection) {
@Override
protected InputStream getInitialContents() {
String contents = AbstractNewSightlyFileWizard.this.getInitialContents();
return new ByteArrayInputStream(contents.getBytes());
}
@Override
protected boolean validatePage() {
return super.validatePage() && validateFileToBeCreated();
}
};
if (getInitialFileName() != null) {
fileCreationPage.setFileName(getInitialFileName());
}
fileCreationPage.setTitle("Sightly");
fileCreationPage.setDescription(wizardDescription);
fileCreationPage.setImageDescriptor(SharedImages.SIGHTLY_WIZARD_BANNER);
setWindowTitle(pageTitle);
addPage(fileCreationPage);
}
use of org.eclipse.ui.dialogs.WizardNewFileCreationPage in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationMainTab method handlePropertyFileCreate.
private void handlePropertyFileCreate() {
Wizard wizard = new Wizard() {
String pageName = HibernateConsoleMessages.ConsoleConfigurationMainTab_create_property_file;
WizardNewFileCreationPage cPage = null;
@Override
public void addPages() {
StructuredSelection selection = null;
IJavaProject project = findJavaProject();
if (project != null) {
selection = new StructuredSelection(project);
} else {
selection = StructuredSelection.EMPTY;
}
cPage = new WizardNewFileCreationPage(pageName, selection);
cPage.setTitle(HibernateConsoleMessages.ConsoleConfigurationMainTab_create_hibernate_properties_file);
cPage.setDescription(HibernateConsoleMessages.ConsoleConfigurationMainTab_create_new_properties_file);
// $NON-NLS-1$
cPage.setFileName("hibernate.properties");
addPage(cPage);
}
@Override
public boolean performFinish() {
final IFile file = cPage.createNewFile();
propertyFileText.setText(file.getFullPath().toOSString());
return true;
}
};
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
WizardDialog wdialog = new WizardDialog(win.getShell(), wizard);
wdialog.open();
}
use of org.eclipse.ui.dialogs.WizardNewFileCreationPage in project jbosstools-hibernate by jbosstools.
the class ConsoleConfigurationMainTab method handleConfigurationFileCreate.
private void handleConfigurationFileCreate() {
StructuredSelection selection = null;
IJavaProject project = findJavaProject();
if (project != null) {
selection = new StructuredSelection(project);
} else {
selection = StructuredSelection.EMPTY;
}
NewConfigurationWizard wizard = new NewConfigurationWizard();
wizard.init(PlatformUI.getWorkbench(), selection);
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
WizardDialog wdialog = new WizardDialog(win.getShell(), wizard);
wdialog.create();
IWizardPage configPage = wizard.getPage(HibernateConsoleMessages.ConsoleConfigurationMainTab_wizard_page);
if (configPage != null && configPage instanceof NewConfigurationWizardPage) {
((NewConfigurationWizardPage) configPage).setCreateConsoleConfigurationVisible(false);
String cpName = nonEmptyTrimOrNull(connectionProfileCtrl.getSelectedConnectionName());
if (cpName != null && !ConnectionProfileCtrl.JPA_CONNECTIN_NAME.equals(cpName) && !ConnectionProfileCtrl.NO_CONNECTIN_NAME.equals(cpName))
((NewConfigurationWizardPage) configPage).setConnectionProfileName(connectionProfileCtrl.getSelectedConnectionName());
}
// This opens a dialog
if (wdialog.open() == Window.OK) {
WizardNewFileCreationPage createdFilePath = ((WizardNewFileCreationPage) wizard.getStartingPage());
if (createdFilePath != null) {
// createNewFile() does not creates new file if it was created by wizard (OK was pressed)
configurationFileText.setText(createdFilePath.createNewFile().getFullPath().toOSString());
}
}
}
use of org.eclipse.ui.dialogs.WizardNewFileCreationPage in project jbosstools-hibernate by jbosstools.
the class NewHibernateMappingFileWizard method addPages.
@Override
public void addPages() {
super.addPages();
if (selection == null) {
selection = new StructuredSelection();
}
page0 = new NewHibernateMappingElementsSelectionPage2(JdtUiMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file, selection);
page0.setTitle(JdtUiMessages.NewHibernateMappingElementsSelectionPage2_title);
page0.setDescription(JdtUiMessages.NewHibernateMappingElementsSelectionPage2_description);
addPage(page0);
// $NON-NLS-1$
cPage = new WizardNewFileCreationPage("Ccfgxml", selection);
cPage.setTitle(JdtUiMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file);
cPage.setDescription(JdtUiMessages.NewHibernateMappingFileWizard_create_empty_xml_mapping_file);
// $NON-NLS-1$
cPage.setFileName("hibernate.hbm.xml");
addPage(cPage);
page2 = new NewHibernateMappingFilePage(false);
page2.setTitle(JdtUiMessages.NewHibernateMappingFilePage_title);
page2.setMessage(JdtUiMessages.NewHibernateMappingFilePage_this_wizard_creates, IMessageProvider.WARNING);
addPage(page2);
previewPage = new NewHibernateMappingPreviewPage();
previewPage.setTitle(JdtUiMessages.NewHibernateMappingPreviewPage_title);
addPage(previewPage);
}
Aggregations