import org.eclipse.core.runtime.IPath;
public class LoadPathEntry {
- public static final String TYPE_PROJECT = "project";
-
- protected IProject project;
- protected String type;
-
- public LoadPathEntry(IProject aProjectEntry) {
- project = aProjectEntry;
- type = TYPE_PROJECT;
- }
-
- public IPath getPath() {
- return project.getFullPath();
- }
-
- public IProject getProject() {
- return project;
- }
-
- public String getType() {
- return type;
- }
-
- public String toXML() {
- StringBuffer buffer = new StringBuffer();
-
- buffer.append("<pathentry type=\"");
- buffer.append(type + "\" ");
- buffer.append("path=\"" + getPath() + "\"/>");
-
- return buffer.toString();
- }
+ public static final String TYPE_PROJECT = "project";
+
+ protected IProject project;
+ protected String type;
+
+ public LoadPathEntry(IProject aProjectEntry) {
+ project = aProjectEntry;
+ type = TYPE_PROJECT;
+ }
+
+ public IPath getPath() {
+ return project.getFullPath();
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String toXML() {
+ StringBuffer buffer = new StringBuffer();
+
+ buffer.append("<pathentry type=\"");
+ buffer.append(type + "\" ");
+ buffer.append("path=\"" + getPath() + "\"/>");
+
+ return buffer.toString();
+ }
}
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-public class PHPLanguagePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- private ArrayList RadioButtons = new ArrayList();
+public class PHPLanguagePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ private ArrayList RadioButtons = new ArrayList();
- protected Control createContents(Composite parent) {
- Composite lingoComposite= new Composite(parent, SWT.NULL);
- lingoComposite.setLayout(new GridLayout());
- Group lingoGroup= new Group(lingoComposite, SWT.NONE);
- lingoGroup.setText(PHPPreferencesMessages.getString("PHPLanguagePreferencePage.preflingo"));
- lingoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- lingoGroup.setLayout(new GridLayout());
- Label lg = new Label(lingoGroup, SWT.WRAP);
- lg.setText(PHPPreferencesMessages.getString("PHPLanguagePreferencePage.choose"));
- addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.english"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_EN_GB); //$NON-NLS-1$
- addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.german"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_DE); //$NON-NLS-1$
- addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.french"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_FR); //$NON-NLS-1$
- return lingoComposite;
- }
- public void init(IWorkbench arg0) {
- }
- private Button addRadioButton(Composite parent, String label, String key, String value) {
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- Button button= new Button(parent, SWT.RADIO);
- button.setText(label);
- button.setData(new String[] { key, value });
- button.setLayoutData(gd);
- button.setSelection(value.equals(PHPeclipsePlugin.getDefault().getPreferenceStore().getString(key)));
- RadioButtons.add(button);
- return button;
- }
-
- protected void performDefaults() {
- IPreferenceStore store= getPreferenceStore();
- for (int i= 0; i < RadioButtons.size(); i++) {
- Button button= (Button) RadioButtons.get(i);
- String[] info= (String[]) button.getData();
- button.setSelection(info[1].equals(store.getDefaultString(info[0])));
- }
- super.performDefaults();
- }
+ protected Control createContents(Composite parent) {
+ Composite lingoComposite = new Composite(parent, SWT.NULL);
+ lingoComposite.setLayout(new GridLayout());
+ Group lingoGroup = new Group(lingoComposite, SWT.NONE);
+ lingoGroup.setText(PHPPreferencesMessages.getString("PHPLanguagePreferencePage.preflingo"));
+ lingoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ lingoGroup.setLayout(new GridLayout());
+ Label lg = new Label(lingoGroup, SWT.WRAP);
+ lg.setText(PHPPreferencesMessages.getString("PHPLanguagePreferencePage.choose"));
+ addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.english"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_EN_GB); //$NON-NLS-1$
+ addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.german"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_DE); //$NON-NLS-1$
+ addRadioButton(lingoGroup, PHPPreferencesMessages.getString("PHPLanguagePreferencePage.french"), IPreferenceConstants.RESOURCE_BUNDLE, IPreferenceConstants.RESOURCE_BUNDLE_FR); //$NON-NLS-1$
+ return lingoComposite;
+ }
+ public void init(IWorkbench arg0) {
+ }
+ private Button addRadioButton(Composite parent, String label, String key, String value) {
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ Button button = new Button(parent, SWT.RADIO);
+ button.setText(label);
+ button.setData(new String[] { key, value });
+ button.setLayoutData(gd);
+ button.setSelection(value.equals(PHPeclipsePlugin.getDefault().getPreferenceStore().getString(key)));
+ RadioButtons.add(button);
+ return button;
+ }
- public boolean performOk() {
- IPreferenceStore store= PHPeclipsePlugin.getDefault().getPreferenceStore();
- for (int i= 0; i < RadioButtons.size(); i++) {
- Button button= (Button) RadioButtons.get(i);
- if (button.getSelection()) {
- String[] info= (String[]) button.getData();
- store.setValue(info[0], info[1]);
- }
- }
- PHPeclipsePlugin.getDefault().savePluginPreferences();
- PHPPreferencesMessages.setResourceBundle(
- PHPeclipsePlugin.getDefault().getPreferenceStore().getString(IPreferenceConstants.RESOURCE_BUNDLE));
-
- return super.performOk();
- }
-}
+ protected void performDefaults() {
+ IPreferenceStore store = getPreferenceStore();
+ for (int i = 0; i < RadioButtons.size(); i++) {
+ Button button = (Button) RadioButtons.get(i);
+ String[] info = (String[]) button.getData();
+ button.setSelection(info[1].equals(store.getDefaultString(info[0])));
+ }
+ super.performDefaults();
+ }
+
+ public boolean performOk() {
+ IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore();
+ for (int i = 0; i < RadioButtons.size(); i++) {
+ Button button = (Button) RadioButtons.get(i);
+ if (button.getSelection()) {
+ String[] info = (String[]) button.getData();
+ store.setValue(info[0], info[1]);
+ }
+ }
+ PHPeclipsePlugin.getDefault().savePluginPreferences();
+ PHPPreferencesMessages.setResourceBundle(
+ PHPeclipsePlugin.getDefault().getPreferenceStore().getString(IPreferenceConstants.RESOURCE_BUNDLE));
+ return super.performOk();
+ }
+}
-
package net.sourceforge.phpeclipse;
import org.eclipse.debug.ui.IDebugUIConstants;
public class PHPPerspectiveFactory implements IPerspectiveFactory {
- public PHPPerspectiveFactory() {
- super();
- }
+ public PHPPerspectiveFactory() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout layout) {
+ String editorArea = layout.getEditorArea();
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
-
-// IFolderLayout phpResourcesArea = layout.createFolder("phpresourcesarea", IPageLayout.LEFT, (float)0.25, editorArea);
-// phpResourcesArea.addView(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
- IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$
+ // IFolderLayout phpResourcesArea = layout.createFolder("phpresourcesarea", IPageLayout.LEFT, (float)0.25, editorArea);
+ // phpResourcesArea.addView(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
+ IFolderLayout folder = layout.createFolder("left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
folder.addView(IPageLayout.ID_RES_NAV);
folder.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- IFolderLayout consoleArea = layout.createFolder("consoleArea", IPageLayout.BOTTOM, (float)0.75, editorArea);
-
- consoleArea.addView(IPageLayout.ID_TASK_LIST);
+
+ IFolderLayout consoleArea = layout.createFolder("consoleArea", IPageLayout.BOTTOM, (float) 0.75, editorArea);
+
+ consoleArea.addView(IPageLayout.ID_TASK_LIST);
consoleArea.addView(IDebugUIConstants.ID_CONSOLE_VIEW);
consoleArea.addView(IPageLayout.ID_BOOKMARKS);
-
- layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float)0.75, editorArea);
-
- layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
-
- layout.addShowViewShortcut(IDebugUIConstants.ID_CONSOLE_VIEW);
-
- layout.addShowViewShortcut(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
-
+
+ layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float) 0.75, editorArea);
+
+ layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
+
+ layout.addShowViewShortcut(IDebugUIConstants.ID_CONSOLE_VIEW);
+
+ layout.addShowViewShortcut(PHPeclipsePlugin.PHP_RESOURCES_VIEW_ID);
+
// views - standard workbench
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
-
+
// new actions - PHP project creation wizards
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
- }
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
+ }
}