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


Java SaveAsDialog.setTitle方法代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.SaveAsDialog.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java SaveAsDialog.setTitle方法的具体用法?Java SaveAsDialog.setTitle怎么用?Java SaveAsDialog.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.dialogs.SaveAsDialog的用法示例。


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

示例1: doSaveAs

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
@Override
public void doSaveAs()
{
	SaveAsDialog dialog = new SaveAsDialog(getEditorSite().getShell());
	dialog.setOriginalFile(file);
	dialog.setTitle("Speichern unter");
	int result = dialog.open();
	if (result == Dialog.OK) try
	{
		SerializationManager.save(map, ResourcesPlugin.getWorkspace().getRoot().getFile(dialog.getResult()));
		setDirty(false);
	}
	catch(ResourceException e)
	{
		showError("Datei konnte nicht gespeichert werden.", e);
	}
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:18,代码来源:TerrainEditor.java

示例2: handleProjectJarnameBrowse

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleProjectJarnameBrowse() {
	String jarname = getJarname();
	SaveAsDialog dialog = new SaveAsDialog(getShell());
	String name = jarname;
	if (name == null) {
		name = "fatjar_output.jar";
	}
	IProject project = jproject.getProject();

	IFile iFile = project.getFile(name);

	dialog.setOriginalFile(iFile);
	dialog.setTitle("Select Output Jar-Name"); //$NON-NLS-1$

	if (dialog.open() == SaveAsDialog.OK) {
		IPath saveFile = dialog.getResult();
		if (saveFile != null) {
			String path = saveFile.toString();
			String projectName = jproject.getElementName();
			if (!path.startsWith("/" + projectName + "/")) {
				MessageDialog.openInformation(getShell(), "Fat Jar Select Output",
						"output must be stored in project " + projectName);
			} else {
				if (!"jar".equals(saveFile.getFileExtension().toLowerCase()))
					saveFile = saveFile.addFileExtension("jar");
				saveFile = saveFile.removeFirstSegments(1).removeTrailingSeparator();
				jarnameText.setText(saveFile.toOSString());
			}
		}
	}
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:37,代码来源:FJExportWizardConfigPage.java

示例3: handleProjectJarnameBrowse

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

private void handleProjectJarnameBrowse() {

        String jarname = getJarname();
        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = jarname;
        if (name == null) {
                name = "fatjar_output.jar";
        }
        IFile iFile = jproject.getIFile(name);
        
        dialog.setOriginalFile(iFile);
        dialog.setTitle("Select Output Jar-Name"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
                IPath saveFile= dialog.getResult();
                if (saveFile != null) {
                        String path = saveFile.toString();
                        String projectName = jproject.getJproject().getElementName();
                        if (!path.startsWith("/" + projectName + "/")) {
                                MessageDialog.openInformation(getShell(), "Fat Jar Select Output", "output must be stored in project " + projectName);
                        }
                        else {
                                if (!"jar".equals(saveFile.getFileExtension().toLowerCase()))
                                        saveFile = saveFile.addFileExtension("jar");
                                saveFile = saveFile.removeFirstSegments(1).removeTrailingSeparator();
                                jarnameText.setText(saveFile.toOSString());
                        }
                }
        }
}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:36,代码来源:ConfigPage.java

示例4: handleSaveSettings

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private void handleSaveSettings() {

        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = BuildFatJar.absPropertiesFilename;
        if (name == null) {
            name = "settings.fatjar";
        }
        int pos = name.lastIndexOf(File.separatorChar);
        if (pos != -1) {
            name = name.substring(pos+1);
        }
        IProject project = jproject.getJproject().getProject();
        
        IFile iFile = project.getFile(name);
        
        
        dialog.setOriginalFile(iFile);
//        dialog.setOriginalName(name);
        dialog.setTitle("Save FatJar Settings"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
            IPath saveFile= dialog.getResult();
            if (saveFile != null) {
                String path = saveFile.toString();
                String projectName = jproject.getJproject().getElementName();
                if (!path.startsWith("/" + projectName + "/")) {
                    MessageDialog.openInformation(getShell(), "Fat Jar Save Settings", "settings must be stored in project " + projectName);
                }
                else {
                    if (!"fatjar".equals(saveFile.getFileExtension()))
                        saveFile = saveFile.addFileExtension("fatjar");
                    BuildProperties buildProps = fjew.getBuildProperties();
                    if (buildProps != null) {
                        saveConfig(saveFile, buildProps.toProperties());
                    }
                }
            }
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:40,代码来源:FilesSelectPage.java

示例5: handleExportANT

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private void handleExportANT() {

        SaveAsDialog dialog = new SaveAsDialog(getShell());
        String name = "build.xml";

        IProject project = jproject.getJproject().getProject();
        
        IFile iFile = project.getFile(name);
        
        dialog.setOriginalFile(iFile);
//        dialog.setOriginalName(name);
        dialog.setTitle("Export ANT build file"); //$NON-NLS-1$

        if (dialog.open() == SaveAsDialog.OK) {
            IPath saveFile= dialog.getResult();
            if (saveFile != null) {
                String path = saveFile.toString();
                String projectName = jproject.getJproject().getElementName();
                if (!"xml".equals(saveFile.getFileExtension()))
                    saveFile = saveFile.addFileExtension("xml");
                
                boolean ok = true;
                IFile buildFile = project.getWorkspace().getRoot().getFile(saveFile);
                if (buildFile != null) {
                    IStatus status = AguiPlugin.askFileWriteAccess(buildFile);
                    if ((status != null) && !status.isOK()) {
                        ok = false;
                        Shell shell = new Shell();
                        MessageDialog.openError(shell, "Fat Jar Plug-In Error", "Export ANT, write access denied: " + status.toString());
                    }
                }
                if (ok) {
                    SourceInfo[] sourceInfo = getANTBuildInfo();
                    exportANTBuild(saveFile, sourceInfo);
                }
            }
        }
    }
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:39,代码来源:FilesSelectPage.java

示例6: handleSaveSettings

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private void handleSaveSettings() {

		SaveAsDialog dialog = new SaveAsDialog(getShell());
		String name = BuildFatJar.absPropertiesFilename;
		if (name == null) {
			name = "settings.fatjar";
		}
		int pos = name.lastIndexOf(File.separatorChar);
		if (pos != -1) {
			name = name.substring(pos + 1);
		}
		IProject project = jproject.getProject();

		IFile iFile = project.getFile(name);

		dialog.setOriginalFile(iFile);
		// dialog.setOriginalName(name);
		dialog.setTitle("Save FatJar Settings"); //$NON-NLS-1$

		if (dialog.open() == SaveAsDialog.OK) {
			IPath saveFile = dialog.getResult();
			if (saveFile != null) {
				String path = saveFile.toString();
				String projectName = jproject.getElementName();
				if (!path.startsWith("/" + projectName + "/")) {
					MessageDialog
							.openInformation(getShell(),
									"Fat Jar Save Settings",
									"settings must be stored in project "
											+ projectName);
				} else {
					if (!"fatjar".equals(saveFile.getFileExtension()))
						saveFile = saveFile.addFileExtension("fatjar");
					Properties props = fjew.getProperties();
					if (props != null) {
						saveConfig(saveFile, props);
					}
				}
			}
		}
	}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:42,代码来源:FJExportWizardFilesSelectPage.java

示例7: handleExportANT

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
private void handleExportANT() {

		SaveAsDialog dialog = new SaveAsDialog(getShell());
		String name = "build.xml";

		IProject project = jproject.getProject();

		IFile iFile = project.getFile(name);

		dialog.setOriginalFile(iFile);
		// dialog.setOriginalName(name);
		dialog.setTitle("Export ANT build file"); //$NON-NLS-1$

		if (dialog.open() == SaveAsDialog.OK) {
			IPath saveFile = dialog.getResult();
			if (saveFile != null) {
				String path = saveFile.toString();
				String projectName = jproject.getElementName();
				if (!"xml".equals(saveFile.getFileExtension()))
					saveFile = saveFile.addFileExtension("xml");

				boolean ok = true;
				IFile buildFile = project.getWorkspace().getRoot().getFile(
						saveFile);
				if (buildFile != null) {
					IStatus status = AguiPlugin.askFileWriteAccess(buildFile);
					if ((status != null) && !status.isOK()) {
						ok = false;
						Shell shell = new Shell();
						MessageDialog.openError(shell, "Fat Jar Plug-In Error",
								"Export ANT, write access denied: "
										+ status.toString());
					}
				}
				if (ok) {
					SourceInfo[] sourceInfo = getANTBuildInfo();
					exportANTBuild(saveFile, sourceInfo);
				}
			}
		}
	}
 
开发者ID:thahn0720,项目名称:agui_eclipse_plugin,代码行数:42,代码来源:FJExportWizardFilesSelectPage.java

示例8: execute

import org.eclipse.ui.dialogs.SaveAsDialog; //导入方法依赖的package包/类
/**
 * Execute command.
 * 
 * @param event the event argument.
 * @throws ExecutionException the ExecutionException.
 * @return null.
 */
public Object execute(ExecutionEvent event) throws ExecutionException {

    try {
        ISelection selection = HandlerUtil.getCurrentSelection(event);
        if (!(selection instanceof StructuredSelection)) {
            return null;
        }

        StructuredSelection structuredSelection = (StructuredSelection) selection;
        if (structuredSelection.isEmpty()) {
            return null;
        }

        // gets the diagram file.
        IFile selectedDiagramFile = (IFile) structuredSelection.getFirstElement();

        // gets model.
        IFile selectedModelFile = ModelUtil
                .getModelFileFromDiagramFile(selectedDiagramFile);
        if (!selectedModelFile.exists()) {
            MessageWriter
                    .showErrorMessageBox(Messages.CopyDcaseFileSelectionAdapter_1);
            return null;
        }
        // shows a dialog to select target.
        SaveAsDialog dialog = new SaveAsDialog(DcaseEditorUtil
                .getActiveWindowShell());
        dialog.setOriginalFile(selectedDiagramFile);
        dialog.create();
        dialog.setTitle(Messages.CopyDcaseFileSelectionAdapter_2);
        dialog.setMessage(Messages.CopyDcaseFileSelectionAdapter_3);
        dialog.getShell().setText(Messages.CopyDcaseFileSelectionAdapter_2);

        // terminates if canceled.
        if (dialog.open() == Window.CANCEL) {
            return null;
        }
        // gets target path.
        IPath destDiagramPath = dialog.getResult();
        if (destDiagramPath == null) {
            return null;
        }
        // removes file extension.
        
        IPath destBase = destDiagramPath.removeFileExtension();

        // copies diagram.
        IFile destDiagramFile = ResourcesPlugin.getWorkspace().getRoot()
                .getFile(
                        destBase.addFileExtension(selectedDiagramFile
                                .getFileExtension()));
        // copies model.
        IFile destModelPath = FileUtil.copyFileTo(selectedModelFile,
                destBase.addFileExtension(selectedModelFile.getFileExtension()));

        // updates the reference to the GMF model file of the GMF diagram file.
        ModelUtil.updateModelFileReference(selectedDiagramFile,
                destModelPath, destDiagramFile, false);
    } catch (DcaseSystemException de) {
        MessageWriter.writeMessageToErrorLog(de);
        MessageWriter.showMessageBoxSeeErroLog();
    }
    return null;
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:72,代码来源:CopyDcaseFileHandler.java


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