本文整理汇总了Java中org.eclipse.ui.dialogs.NewFolderDialog类的典型用法代码示例。如果您正苦于以下问题:Java NewFolderDialog类的具体用法?Java NewFolderDialog怎么用?Java NewFolderDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NewFolderDialog类属于org.eclipse.ui.dialogs包,在下文中一共展示了NewFolderDialog类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: newFolderButtonPressed
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
protected void newFolderButtonPressed() {
NewFolderDialog dialog = new NewFolderDialog(getShell(),
fSelectedContainer);
if (dialog.open() == Window.OK) {
TreeViewer treeViewer = getTreeViewer();
treeViewer.refresh(fSelectedContainer);
Object createdFolder = dialog.getResult()[0];
treeViewer.reveal(createdFolder);
treeViewer.setSelection(new StructuredSelection(createdFolder));
}
}
开发者ID:angelozerr,项目名称:typescript.java,代码行数:12,代码来源:FolderSelectionDialog.java
示例2: newFolderButtonPressed
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
protected void newFolderButtonPressed() {
NewFolderDialog dialog= new NewFolderDialog(getShell(), fSelectedContainer);
if (dialog.open() == Window.OK) {
CheckboxTreeViewer treeViewer= fViewer;
treeViewer.refresh(fSelectedContainer);
Object createdFolder= dialog.getResult()[0];
treeViewer.reveal(createdFolder);
treeViewer.setChecked(createdFolder, true);
treeViewer.setSelection(new StructuredSelection(createdFolder));
updateOKStatus();
}
}
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:13,代码来源:MultipleFolderSelectionDialog.java
示例3: openNewFolderDialog
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
private PathListElement openNewFolderDialog(PathListElement existing) {
NewFolderDialog dialog = new NewFolderDialog(getShell(), project);
dialog.setTitle("Create new folder...");
if (dialog.open() == Window.OK) {
IResource createdFolder = (IResource) dialog.getResult()[0];
return newFolderElement(createdFolder);
}
return null;
}
开发者ID:iloveeclipse,项目名称:filesync4eclipse,代码行数:10,代码来源:ProjectSyncPropertyPage.java
示例4: createFolder
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
protected Object createFolder(IContainer container) {
NewFolderDialog dialog= new NewFolderDialog(getShell(), container);
if (dialog.open() == Window.OK) {
return dialog.getResult()[0];
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:MultipleFolderSelectionDialog.java
示例5: getDefaultCreateFolderQuery
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
/**
* Shows the UI to create a new source folder.
*
* @param shell The parent shell for the dialog, can be <code>null</code>
* @param project the Java project to create the source folder for
* @return returns the query
*/
public static ICreateFolderQuery getDefaultCreateFolderQuery(final Shell shell, final IJavaProject project) {
return new ICreateFolderQuery() {
private IFolder fNewFolder;
public boolean doQuery() {
final boolean[] isOK= {false};
Display.getDefault().syncExec(new Runnable() {
public void run() {
Shell sh= shell != null ? shell : JavaPlugin.getActiveWorkbenchShell();
NewFolderDialog dialog= new NewFolderDialog(sh, project.getProject());
isOK[0]= dialog.open() == Window.OK;
if (isOK[0]) {
IResource sourceContainer= (IResource) dialog.getResult()[0];
if (sourceContainer instanceof IFolder) {
fNewFolder= (IFolder)sourceContainer;
} else {
fNewFolder= null;
}
}
}
});
return isOK[0];
}
public boolean isSourceFolder() {
return true;
}
public IFolder getCreatedFolder() {
return fNewFolder;
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:45,代码来源:ClasspathModifierQueries.java
示例6: newFolderButtonPressed
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
protected void newFolderButtonPressed() {
NewFolderDialog dialog= new NewFolderDialog(getShell(), fSelectedContainer);
if (dialog.open() == Window.OK) {
TreeViewer treeViewer= getTreeViewer();
treeViewer.refresh(fSelectedContainer);
Object createdFolder= dialog.getResult()[0];
treeViewer.reveal(createdFolder);
treeViewer.setSelection(new StructuredSelection(createdFolder));
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:FolderSelectionDialog.java
示例7: execute
import org.eclipse.ui.dialogs.NewFolderDialog; //导入依赖的package包/类
public Object execute(ExecutionEvent event) throws ExecutionException {
Shell shell = HandlerUtil.getActiveShell(event);
String partId = HandlerUtil.getActivePartId(event);
if (partId.equals("net.heartsome.cat.common.ui.navigator.view")) {
// 导航视图处于激活状态
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart viewPart = page.findView("net.heartsome.cat.common.ui.navigator.view");
StructuredSelection selection = (StructuredSelection) viewPart.getSite().getSelectionProvider()
.getSelection();
if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
List<?> lstObj = ((IStructuredSelection) selection).toList();
if (lstObj == null || lstObj.size() != 1) {
MessageDialog.openInformation(shell, Messages.getString("handlers.NewFolderHandler.msgTitle"),
Messages.getString("handlers.NewFolderHandler.msg1"));
return null;
}
IContainer container = null;
for (Object obj : lstObj) {
if (obj instanceof IFile) {
IFile file = (IFile) obj;
container = file.getParent();
} else if (obj instanceof IFolder) {
container = (IFolder) obj;
} else if (obj instanceof IProject) {
container = (IProject) obj;
}
}
ResourcesPlugin.getPlugin().getPluginPreferences().setValue(ResourcesPlugin.PREF_DISABLE_LINKING, true);
NewFolderDialog dialog = new NewFolderDialog(shell, container);
dialog.open();
} else {
MessageDialog.openInformation(shell, Messages.getString("handlers.NewFolderHandler.msgTitle"),
Messages.getString("handlers.NewFolderHandler.msg2"));
return null;
}
} else {
MessageDialog.openInformation(shell, Messages.getString("handlers.NewFolderHandler.msgTitle"),
Messages.getString("handlers.NewFolderHandler.msg2"));
return null;
}
return null;
}
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:43,代码来源:NewFolderHandler.java
注:本文中的org.eclipse.ui.dialogs.NewFolderDialog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论