⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addmusicfolderaction.java

📁 eclise rcp 项目,是非常好的学习源码
💻 JAVA
字号:
/******************************************************************************* * Copyright (c) 2007 Siemens AG *  * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: *    Kai T鰀ter - initial API and implementation *******************************************************************************/package com.siemens.ct.mp3m.actions;import org.eclipse.jface.action.IAction;import org.eclipse.jface.viewers.ISelection;import org.eclipse.swt.widgets.DirectoryDialog;import org.eclipse.ui.IWorkbenchWindow;import org.eclipse.ui.IWorkbenchWindowActionDelegate;import com.siemens.ct.mp3m.ModelInitializer;import com.siemens.ct.mp3m.model.physical.MusicFolders;public class AddMusicFolderAction implements IWorkbenchWindowActionDelegate {    private IWorkbenchWindow window;    public void run(IAction action) {        DirectoryDialog d = new DirectoryDialog(window.getShell());        String folder = d.open();        if (folder != null) {            MusicFolders.addMusicFolder(folder);            ModelInitializer.createTree();        }    }    public void dispose() {        window = null;    }    public void init(IWorkbenchWindow window) {        this.window = window;    }    public void selectionChanged(IAction action, ISelection selection) {        // TODO Auto-generated method stub    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -