1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.codeassist.impl;
15 public class AssistOptions {
19 public static final String OPTION_PerformVisibilityCheck =
20 "org.eclipse.jdt.core.codeComplete.visibilityCheck"; //$NON-NLS-1$
21 public static final String OPTION_ForceImplicitQualification =
22 "org.eclipse.jdt.core.codeComplete.forceImplicitQualification"; //$NON-NLS-1$
23 public static final String ENABLED = "enabled"; //$NON-NLS-1$
24 public static final String DISABLED = "disabled"; //$NON-NLS-1$
26 public boolean checkVisibility = false;
27 public boolean forceImplicitQualification = false;
30 * Initializing the assist options with default settings
32 public AssistOptions() {
36 * Initializing the assist options with external settings
38 public AssistOptions(Map settings) {
42 // filter options which are related to the assist component
43 Object[] entries = settings.entrySet().toArray();
44 for (int i = 0, max = entries.length; i < max; i++) {
45 Map.Entry entry = (Map.Entry) entries[i];
46 if (!(entry.getKey() instanceof String))
48 if (!(entry.getValue() instanceof String))
50 String optionID = (String) entry.getKey();
51 String optionValue = (String) entry.getValue();
53 if (optionID.equals(OPTION_PerformVisibilityCheck)) {
54 if (optionValue.equals(ENABLED)) {
55 this.checkVisibility = true;
57 if (optionValue.equals(DISABLED)) {
58 this.checkVisibility = false;
61 } else if (optionID.equals(OPTION_ForceImplicitQualification)) {
62 if (optionValue.equals(ENABLED)) {
63 this.forceImplicitQualification = true;
65 if (optionValue.equals(DISABLED)) {
66 this.forceImplicitQualification = false;